Skip to content

Commit

Permalink
Build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilWindle committed Sep 13, 2023
1 parent c943849 commit 90c2bc3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions build-system/scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ echo "Content hash: $CONTENT_HASH"

cd $BUILD_DIR

SINGLE_ARCH="false"
MULTI_ARCH="false"
if [[ $PLATFORMS != "linux/amd64" ]]; then
SINGLE_ARCH="true"
MULTI_ARCH="true"
retry ensure_docker_buildx
echo "Creating multi-platform builder"
docker buildx create --name multi-platform-builder --bootstrap --use
Expand Down Expand Up @@ -175,8 +175,7 @@ for STAGE in $STAGES; do

echo "Building stage: $STAGE"
STAGE_IMAGE_COMMIT_URI=$ECR_URL/$REPOSITORY:cache-$CONTENT_HASH-$STAGE
echo "buildx tag $STAGE_IMAGE_COMMIT_URI"
if [[ $SINGLE_ARCH == "false" ]]; then
if [[ $MULTI_ARCH == "true" ]]; then
# Build our dockerfile, add timing information
docker buildx build --platform $PLATFORMS --target $STAGE $STAGE_CACHE_FROM -t $STAGE_IMAGE_COMMIT_URI -f $DOCKERFILE --build-arg COMMIT_TAG=$COMMIT_TAG_VERSION --build-arg ARG_CONTENT_HASH=$CONTENT_HASH --push . \
| while read line ; do echo "$(date "+%H:%M:%S")| $line"; done
Expand Down Expand Up @@ -206,7 +205,7 @@ fi
# Build the actual image and give it a commit tag.
IMAGE_COMMIT_URI=$ECR_URL/$REPOSITORY:cache-$CONTENT_HASH
echo "Building image: $IMAGE_COMMIT_URI"
if [[ $SINGLE_ARCH == "false" ]]; then
if [[ $MULTI_ARCH == "true" ]]; then
# Build our dockerfile, add timing information
docker buildx build --platform $PLATFORMS --target $STAGE $STAGE_CACHE_FROM -t $STAGE_IMAGE_COMMIT_URI -f $DOCKERFILE --build-arg COMMIT_TAG=$COMMIT_TAG_VERSION --build-arg ARG_CONTENT_HASH=$CONTENT_HASH --push . \
| while read line ; do echo "$(date "+%H:%M:%S")| $line"; done
Expand Down

0 comments on commit 90c2bc3

Please sign in to comment.