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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Docker image for linux/aarch64 #1206

Merged
merged 5 commits into from
Mar 27, 2022
Merged
Changes from 1 commit
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
15 changes: 14 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,23 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- linux/amd64
- linux/aarch64
ivy marked this conversation as resolved.
Show resolved Hide resolved
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: ${{ matrix.platform }}
- name: Set up Docker Buildx
id: buildx
ivy marked this conversation as resolved.
Show resolved Hide resolved
uses: docker/setup-buildx-action@v1
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
Expand All @@ -30,8 +42,9 @@ jobs:
- name: Build and push
uses: docker/build-push-action@v2
with:
platforms: ${{ matrix.platform }}
Copy link
Member

Choose a reason for hiding this comment

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

Is this right to be doing a matrix build/push for each platform? Do new platforms push into existing images?

If not, remove the matrix from this job and add a platforms output. Then, split docker run out into a test job. That job will be a matrix job, using the platforms output from the build job to set the platform list for the matrix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. After looking more closely with docker image inspect, this might not be working the way I'd assumed. 馃槄

push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: docker run
run: docker run ghcr.io/${{ github.repository }}:${{ steps.meta.outputs.version }} -v
run: docker run --platform ${{ matrix.platform }} ghcr.io/${{ github.repository }}:${{ steps.meta.outputs.version }} -v