Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi-arch support for base image #5888

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading