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

ci: Build Docker for arm64 arch #1423

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
13 changes: 12 additions & 1 deletion .github/workflows/build-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ on:
ref:
required: true
type: string
workflow_dispatch:
inputs:
ref:
description: The ref to build from.
required: true
type: string

# By default, run all commands in a bash shell. On Windows, the default would
# otherwise be powershell.
Expand All @@ -32,6 +38,11 @@ jobs:
ref: ${{ inputs.ref }}
submodules: recursive

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this use qemu for emulation? How slow is it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it does, and it's quite slow, took 1h on my gh action. Best would be to setup a matrix step on an external runner like you did on other actions but I can't setup this myself.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I want to add 1h of emulated Docker builds to every PR. Let me try to set it up through our self-hosted runners, at least until GitHub starts offering Arm Linux runners publicly.


- name: Build
shell: bash
run: docker buildx build .
run: docker buildx build --platform linux/amd64,linux/arm64 .
11 changes: 9 additions & 2 deletions .github/workflows/publish-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,38 @@ jobs:
submodules: recursive
fetch-tags: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_CI_USERNAME }}
password: ${{ secrets.DOCKERHUB_CI_TOKEN }}

- name: Push to Docker Hub
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
# Important: use actions/checkout source, which has the right tags!
# Without context: ., this action will try to fetch git source
# itself, and it will be unable to determine the correct version
# number.
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ secrets.DOCKERHUB_PACKAGE_NAME }}:${{ inputs.tag }}

- name: Push to Docker Hub as "latest"
if: ${{ inputs.latest }}
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
# Important: use actions/checkout source, which has the right tags!
# Without context: ., this action will try to fetch git source
# itself, and it will be unable to determine the correct version
# number.
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ secrets.DOCKERHUB_PACKAGE_NAME }}:latest
Loading