From 276d487bad5c6b42002ba7c1d402d14504ab0e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mitja=20=C5=BDivkovi=C4=87?= Date: Fri, 22 Apr 2022 10:52:33 +0200 Subject: [PATCH] added multi-arch docker build for linux/arm64/v8 --- bin/docker/build_and_push_docker | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/docker/build_and_push_docker b/bin/docker/build_and_push_docker index 50d57a36b5c..c1a4978d9c0 100755 --- a/bin/docker/build_and_push_docker +++ b/bin/docker/build_and_push_docker @@ -1,4 +1,4 @@ #!/bin/bash -if [ $DOCKER_HUB_USERNAME ]; then docker login --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build --rm=false -t $DOCKER_GENERATOR_IMAGE_NAME ./modules/swagger-generator && if [ ! -z "$CIRCLE_TAG" ]; then docker tag $DOCKER_GENERATOR_IMAGE_NAME:latest $DOCKER_GENERATOR_IMAGE_NAME:$CIRCLE_TAG; fi && if [ ! -z "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" = "master" ]; then docker push $DOCKER_GENERATOR_IMAGE_NAME; fi; fi -if [ $DOCKER_HUB_USERNAME ]; then docker login --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build --rm=false -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/swagger-codegen-cli && if [ ! -z "$CIRCLE_TAG" ]; then docker tag $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest $DOCKER_CODEGEN_CLI_IMAGE_NAME:$CIRCLE_TAG; fi && if [ ! -z "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" = "master" ]; then docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME; fi; fi +if [ "$DOCKER_HUB_USERNAME" ]; then docker login --username="$DOCKER_HUB_USERNAME" --password="$DOCKER_HUB_PASSWORD" && docker buildx build --platform linux/arm64/v8,linux/amd64 --rm=false -t "$DOCKER_GENERATOR_IMAGE_NAME" ./modules/swagger-generator && if [ -n "$CIRCLE_TAG" ]; then docker tag "$DOCKER_GENERATOR_IMAGE_NAME:latest" "$DOCKER_GENERATOR_IMAGE_NAME:$CIRCLE_TAG"; fi && if [ -n "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" = "master" ]; then docker push "$DOCKER_GENERATOR_IMAGE_NAME"; fi; fi +if [ "$DOCKER_HUB_USERNAME" ]; then docker login --username="$DOCKER_HUB_USERNAME" --password="$DOCKER_HUB_PASSWORD" && docker buildx build --platform linux/arm64/v8,linux/amd64 --rm=false -t "$DOCKER_CODEGEN_CLI_IMAGE_NAME" ./modules/swagger-codegen-cli && if [ -n "$CIRCLE_TAG" ]; then docker tag "$DOCKER_CODEGEN_CLI_IMAGE_NAME:latest" "$DOCKER_CODEGEN_CLI_IMAGE_NAME:$CIRCLE_TAG"; fi && if [ -n "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" = "master" ]; then docker push "$DOCKER_CODEGEN_CLI_IMAGE_NAME"; fi; fi