From 7886fa0493820dd8d605d1ace374c91c75f7b86a Mon Sep 17 00:00:00 2001 From: anuruddhal Date: Wed, 11 Dec 2024 02:51:07 +0530 Subject: [PATCH 1/4] Remove load parameter from Docker action --- .github/workflows/publish-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 66977cb498..ceeb47be0f 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -100,7 +100,6 @@ jobs: uses: docker/build-push-action@v4 with: context: module-ballerina-docker/base/docker/ - load: true push: false platforms: linux/amd64,linux/arm64 tags: ballerina/ballerina:release-test From c8419c2da8ec3b945db21d751bb50f8d0e7043fe Mon Sep 17 00:00:00 2001 From: anuruddhal Date: Wed, 11 Dec 2024 09:18:05 +0530 Subject: [PATCH 2/4] Remove multi aarch support for release-test image --- .github/workflows/publish-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index ceeb47be0f..da163d2fd6 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -100,8 +100,8 @@ jobs: uses: docker/build-push-action@v4 with: context: module-ballerina-docker/base/docker/ + load: true push: false - platforms: linux/amd64,linux/arm64 tags: ballerina/ballerina:release-test build-args: | BALLERINA_DIST=ballerina-${{ steps.version-set.outputs.sversion }}.zip From 92d3f38222f41320fc74a1fb90cbda488d34a31d Mon Sep 17 00:00:00 2001 From: anuruddhal Date: Wed, 11 Dec 2024 10:22:35 +0530 Subject: [PATCH 3/4] Add multi-arch support for base image --- .../workflows/publish-release-artifacts.yml | 65 +++++++++---------- 1 file changed, 31 insertions(+), 34 deletions(-) diff --git a/.github/workflows/publish-release-artifacts.yml b/.github/workflows/publish-release-artifacts.yml index 1f6e96b68a..4cb731bfe0 100644 --- a/.github/workflows/publish-release-artifacts.yml +++ b/.github/workflows/publish-release-artifacts.yml @@ -117,40 +117,37 @@ jobs: username: ${{ secrets.DOCKER_HUB_USER }} password: ${{ secrets.DOCKER_HUB_TOKEN }} - - name: Process docker - id: process-docker - run: | - git clone --single-branch --branch master https://github.com/ballerina-platform/module-ballerina-docker - DOCKER_REPO='module-ballerina-docker' - echo "::set-output name=dockerRepo::$DOCKER_REPO" - - - name: Enable experimental functions - run: | - echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json - sudo service docker restart - docker version - - - name: Build and push docker image - run: | - DOCKER_REPO=${{ steps.process-docker.outputs.dockerRepo }} - cp $VERSION/ballerina-$VERSION.zip $DOCKER_REPO/base/docker/ - - docker build --no-cache=true --squash --build-arg BALLERINA_DIST=ballerina-$VERSION.zip -t ballerina/ballerina:$GIT_TAG $DOCKER_REPO/base/docker/ - rm $DOCKER_REPO/base/docker/ballerina-$VERSION.zip - docker push ballerina/ballerina:$GIT_TAG - docker rmi ballerina/ballerina:$GIT_TAG - docker image prune -f - - - name: Build and push dev container - run: | - DOCKER_REPO=${{ steps.process-docker.outputs.dockerRepo }} - cp $VERSION/ballerina-$LONG_VERSION-linux-x64.deb $DOCKER_REPO/base/devcontainer/ - - docker build --no-cache=true --squash --build-arg BALLERINA_DIST=ballerina-$LONG_VERSION-linux-x64.deb -t ballerina/ballerina-devcontainer:$GIT_TAG $DOCKER_REPO/base/devcontainer - rm $DOCKER_REPO/base/devcontainer/ballerina-$LONG_VERSION-linux-x64.deb - docker push ballerina/ballerina-devcontainer:$GIT_TAG - docker rmi ballerina/ballerina-devcontainer:$GIT_TAG - docker image prune -f + - name: Checkout Docker repo + uses: actions/checkout@v3 + with: + repository: ballerina-platform/module-ballerina-docker + path: module-ballerina-docker + + - name: Copy zip artifact + run: cp ballerina/build/distributions/ballerina-22*.zip module-ballerina-docker/base/docker/ + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push the Ballerina Docker image + id: docker_build + uses: docker/build-push-action@v6 + with: + context: module-ballerina-docker/base/docker/ + push: true + tags: ballerina/ballerina:$GIT_TAG + platforms: linux/amd64,linux/arm64 + build-args: | + BALLERINA_DIST=ballerina-$VERSION.zip + - name: Build and push dev container image + id: docker_build_devcontainer + uses: docker/build-push-action@v6 + with: + context: module-ballerina-docker/base/devcontainer/ + push: true + tags: ballerina/ballerina-devcontainer:$GIT_TAG + build-args: | + BALLERINA_DIST=ballerina-$LONG_VERSION-linux-x64.deb - name: Publish Artifacts run: | From cb8a9b2efd31d4a92a9fd290c812b3d1101e0c46 Mon Sep 17 00:00:00 2001 From: Tharindu Weerasinghe <52607043+tharindu-nw@users.noreply.github.com> Date: Wed, 11 Dec 2024 15:00:40 +0530 Subject: [PATCH 4/4] Fix references in publish-release-artifacts workflow --- .../workflows/publish-release-artifacts.yml | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publish-release-artifacts.yml b/.github/workflows/publish-release-artifacts.yml index 4cb731bfe0..d36580150b 100644 --- a/.github/workflows/publish-release-artifacts.yml +++ b/.github/workflows/publish-release-artifacts.yml @@ -43,6 +43,7 @@ jobs: echo "::set-output name=version::$VERSION" echo "::set-output name=taggedVersion::$TAGGED_VERSION" echo "::set-output name=updateNumber::$UPDATE_NUMBER" + echo "::set-output name=longVersion::$LONG_VERSION" - name: Download artifacts run: | @@ -117,37 +118,45 @@ jobs: username: ${{ secrets.DOCKER_HUB_USER }} password: ${{ secrets.DOCKER_HUB_TOKEN }} - - name: Checkout Docker repo - uses: actions/checkout@v3 - with: - repository: ballerina-platform/module-ballerina-docker - path: module-ballerina-docker + - name: Clone Docker Repo + id: process-docker + run: | + git clone --single-branch --branch master https://github.com/ballerina-platform/module-ballerina-docker + DOCKER_REPO='module-ballerina-docker' + echo "::set-output name=dockerRepo::$DOCKER_REPO" + + - name: Copy artifacts to Docker repo + run: | + DOCKER_REPO=${{ steps.process-docker.outputs.dockerRepo }} + cp $VERSION/ballerina-$VERSION.zip $DOCKER_REPO/base/docker/ + cp $VERSION/ballerina-$LONG_VERSION-linux-x64.deb $DOCKER_REPO/base/devcontainer/ - - name: Copy zip artifact - run: cp ballerina/build/distributions/ballerina-22*.zip module-ballerina-docker/base/docker/ - name: Set up QEMU uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Build and push the Ballerina Docker image id: docker_build uses: docker/build-push-action@v6 with: - context: module-ballerina-docker/base/docker/ + context: ${{ steps.process-docker.outputs.dockerRepo }}/base/docker/ push: true - tags: ballerina/ballerina:$GIT_TAG + tags: ballerina/ballerina:${{ steps.set-version.outputs.taggedVersion }} platforms: linux/amd64,linux/arm64 build-args: | - BALLERINA_DIST=ballerina-$VERSION.zip + BALLERINA_DIST=ballerina-${{ steps.set-version.outputs.version }}.zip + - name: Build and push dev container image id: docker_build_devcontainer uses: docker/build-push-action@v6 with: - context: module-ballerina-docker/base/devcontainer/ + context: ${{ steps.process-docker.outputs.dockerRepo }}/base/devcontainer/ push: true - tags: ballerina/ballerina-devcontainer:$GIT_TAG + tags: ballerina/ballerina-devcontainer:${{ steps.set-version.outputs.taggedVersion }} build-args: | - BALLERINA_DIST=ballerina-$LONG_VERSION-linux-x64.deb + BALLERINA_DIST=ballerina-${{ steps.set-version.outputs.longVersion }}-linux-x64.deb - name: Publish Artifacts run: |