-
Notifications
You must be signed in to change notification settings - Fork 29
feat: docker multi-arch composite actions #1347
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
base: main
Are you sure you want to change the base?
Conversation
…d docker-import-digests-push-manifest
…up, and alphabetize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Just a couple of small issues.
echo "buildkitd-config=${buildkitd_config}" | tee -a "${GITHUB_OUTPUT}" | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this perhaps only be done if multiple platforms are specified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I thought yes initially, but in the instance where someone is running on x64
and building only linux/arm64
, we would need QEMU and not have it... right? In that case we'd have to configure this with a little more logic, and since this QEMU action takes very little time to run... I didn't figure it was worth the effort.
delete_credentials_file: false | ||
|
||
- name: Login to DockerHub | ||
if: ${{ inputs.push == 'true' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be enough to run this only if one of the target images is actually on dockerhub? Same for Login to GAR
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would. I actually made the choice not to include it because we allow registry
to be passed in for both GAR and DockerHub images.... so I coudn't figure out how we'd reliably calculate which registries we're pushing to in the case we get a custom registry name.
The other idea I had was to have registries
as an input.... but given we have images already as an input that can be pushed to their registries, I didn't like the idea of including an extra input.
Now that I read up on it though... it doesn't seem like DockerHub can have any registry name other than docker.io... so maybe we don't even need that input and could key off of an image list having docker.io
as the reason to login to dockerhub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first pass, looks really promising 🙇
steps: | ||
- name: Build Docker Image | ||
id: build | ||
uses: grafana/shared-workflows/actions/docker-build-push-image@main # TODO: Fix version once released |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can set an arbitrary v0.0.0
version here and it'll be bumped to v0.0.1
upon first release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like this?
uses: grafana/shared-workflows/actions/docker-import-digests-push-manifest@docker-import-digests-push-manifest/v0.0.0
This pull request introduces three new composite actions that (together) perform multi-arch docker builds using Grafana's self-hosted runners:
docker-build-push-image
: Intended to replacebuild-push-to-dockerhub
andpush-to-gar-docker
, this handles building and pushing Docker images to both Google Artifact Registry and DockerHub. The action is highly configurable, supports multi-arch builds, and is designed to be extensible for additional registries.docker-export-digest
: For Docker multi-arch builds, exports a Docker image digest as a job artifact.docker-import-digests-push-manifest
: For Docker multi-arch builds, imports Docker digests from the previous action, and composes and pushes a manifest.Related to #1348.
Part of https://github.com/grafana/deployment_tools/issues/320068