From 4d924218bd45558322ceaf9c1759d7fbf3556d0a Mon Sep 17 00:00:00 2001 From: Huyen Nguyen Date: Wed, 2 Oct 2024 21:14:13 +0700 Subject: [PATCH] Setup QEMU --- .github/workflows/workflow-ecr.yml | 34 ++++++++++++++++++------------ build/build.sh | 3 +-- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.github/workflows/workflow-ecr.yml b/.github/workflows/workflow-ecr.yml index 2b743642..b9bc7221 100644 --- a/.github/workflows/workflow-ecr.yml +++ b/.github/workflows/workflow-ecr.yml @@ -16,20 +16,18 @@ jobs: DOCKER_IMAGE_PUBLISHED_TAG: build-arm steps: - name: Checkout - uses: actions/checkout@master - - name : Prepare docker install + uses: actions/checkout@master + - name: Set up QEMU dependency + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Context for Buildx + shell: bash run: | - curl -fsSL https://get.docker.com -o get-docker.sh - sudo sh get-docker.sh - sudo apt -y install jq docker-ce docker-ce-cli containerd.io binfmt-support qemu-user-static - export DOCKER_BUILDKIT=1 - sudo systemctl restart docker - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - - name: Build - run: | - chmod u+x ./build/*.sh - ./build/clean.sh $KRE_VERSION - ./build/build.sh $KRE_VERSION + docker context create builders + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + version: latest + endpoint: builders - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v2 with: @@ -39,6 +37,16 @@ jobs: mask-aws-account-id: "no" - name: Login to Amazon ECR uses: aws-actions/amazon-ecr-login@v1 + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + - name: Build + run: | + chmod u+x ./build/*.sh + ./build/clean.sh $KRE_VERSION + ./build/build.sh $KRE_VERSION - name: Tag Docker image with commit ID run: | docker images diff --git a/build/build.sh b/build/build.sh index b6a0457b..893680f1 100755 --- a/build/build.sh +++ b/build/build.sh @@ -4,5 +4,4 @@ set -xe ksversion=$1 -docker buildx create --name mybuilder --driver docker-container --use --bootstrap -docker buildx build --platform linux/amd64,linux/arm64 --push -t katalon-katalon -f src/Dockerfile --build-arg KATALON_STUDIO_VERSION=$ksversion . \ No newline at end of file +docker buildx build --push --platform linux/amd64,linux/arm64 -t katalon-katalon -f src/Dockerfile --build-arg KATALON_STUDIO_VERSION=$ksversion . \ No newline at end of file