-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable Multi-Arch Building and Pushing for registry viewer (#125)
* update projects to use multi arch build Signed-off-by: Jordan Dubrick <[email protected]> * update dockerfile to customize timeout value Signed-off-by: Jordan Dubrick <[email protected]> * add new script for building/pushing multi arch registry viewer Signed-off-by: Jordan Dubrick <[email protected]> * free disk space and add qemu emulator Signed-off-by: Jordan Dubrick <[email protected]> * use new build/push script and add qemu emulator Signed-off-by: Jordan Dubrick <[email protected]> * add buildx setup to actions Signed-off-by: Jordan Dubrick <[email protected]> * pin sha for buildx setup Signed-off-by: Jordan Dubrick <[email protected]> * increase parallel to 4 Signed-off-by: Jordan Dubrick <[email protected]> * break nx command into 2 separate commands Signed-off-by: Jordan Dubrick <[email protected]> --------- Signed-off-by: Jordan Dubrick <[email protected]>
- Loading branch information
Showing
6 changed files
with
116 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/sh | ||
|
||
# | ||
# Copyright Red Hat | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
ABSOLUTE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
BUILD_DIR=$ABSOLUTE_PATH/.. | ||
# Due to command differences between podman and docker we need to separate the process | ||
# for creating and adding images to a multi-arch manifest | ||
podman=${USE_PODMAN:-false} | ||
# Base Repository | ||
BASE_REPO="quay.io/devfile/registry-viewer" | ||
BASE_TAG="next" | ||
DEFAULT_IMG="$BASE_REPO:$BASE_TAG" | ||
# Platforms to build for | ||
PLATFORMS="linux/amd64,linux/arm64" | ||
|
||
if [ ${podman} == true ]; then | ||
echo "Executing with podman" | ||
|
||
podman manifest create "$DEFAULT_IMG" | ||
|
||
podman build --platform="$PLATFORMS" --manifest "$DEFAULT_IMG" "$BUILD_DIR" \ | ||
--no-cache \ | ||
--build-arg PROJECT_NAME=registry-viewer \ | ||
--build-arg NEXT_PUBLIC_BASE_PATH=${NEXT_PUBLIC_BASE_PATH:-"/viewer"} | ||
|
||
podman manifest push "$DEFAULT_IMG" | ||
|
||
podman manifest rm "$DEFAULT_IMG" | ||
|
||
else | ||
echo "Executing with docker" | ||
|
||
docker buildx create --name registry-viewer-builder | ||
|
||
docker buildx use registry-viewer-builder | ||
|
||
docker buildx build --push --platform="$PLATFORMS" --tag "$DEFAULT_IMG" "$BUILD_DIR" \ | ||
--no-cache \ | ||
--provenance=false \ | ||
--build-arg PROJECT_NAME=registry-viewer \ | ||
--build-arg NEXT_PUBLIC_BASE_PATH=${NEXT_PUBLIC_BASE_PATH:-"/viewer"} | ||
|
||
docker buildx rm registry-viewer-builder | ||
|
||
fi |