Skip to content

Commit

Permalink
Merge pull request #5888 from anuruddhal/master
Browse files Browse the repository at this point in the history
Add multi-arch support for base image
  • Loading branch information
chiranSachintha authored Dec 12, 2024
2 parents 98299ec + cb8a9b2 commit b176cb9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 23 deletions.
50 changes: 28 additions & 22 deletions .github/workflows/publish-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -117,40 +118,45 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Process 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: 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
- 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/
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: Set up QEMU
uses: docker/setup-qemu-action@v3

- 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/
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

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: Build and push the Ballerina Docker image
id: docker_build
uses: docker/build-push-action@v6
with:
context: ${{ steps.process-docker.outputs.dockerRepo }}/base/docker/
push: true
tags: ballerina/ballerina:${{ steps.set-version.outputs.taggedVersion }}
platforms: linux/amd64,linux/arm64
build-args: |
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: ${{ steps.process-docker.outputs.dockerRepo }}/base/devcontainer/
push: true
tags: ballerina/ballerina-devcontainer:${{ steps.set-version.outputs.taggedVersion }}
build-args: |
BALLERINA_DIST=ballerina-${{ steps.set-version.outputs.longVersion }}-linux-x64.deb
- name: Publish Artifacts
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ jobs:
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
Expand Down

0 comments on commit b176cb9

Please sign in to comment.