-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
ref(docker): Use docker buildx (BuildKit) to publish docker images #556
Conversation
2d1a890
to
15f20bd
Compare
Not easy to test craft ... but it works! The publish output:
And the used changelogPolicy: none
statusProvider:
name: github
artifactProvider:
name: none
targets:
- id: release
name: docker
source: ghcr.io/getsentry/relay
sourceFormat: "{{{source}}}:d8e6bbc4e32d7b7d56c3ea6e5d8cecf281e1ab99"
target: dav1d/relay |
15f20bd
to
4f45ee3
Compare
src/targets/docker.ts
Outdated
await this.pull(revision); | ||
await this.push(revision, version); | ||
|
||
if (await this.hasBuildKit()) { |
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'm inclined to just require buildkit and clean up the old code -- it's been around for half a decade
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.
Unfortunately that will fail on OSX, at least it does on my colima install.
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.
what does docker version
give you? I'd be pretty surprised if it's older than 2017
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.
└─ % docker version
Client: Docker Engine - Community
Version: 27.0.3
API version: 1.43 (downgraded from 1.46)
Go version: go1.22.4
Git commit: 7d4bcd863a
Built: Fri Jun 28 14:56:30 2024
OS/Arch: darwin/arm64
Context: colima
Server:
Engine:
Version: 24.0.5
API version: 1.43 (minimum version 1.12)
Go version: go1.20.7
Git commit: 24.0.5-0ubuntu1
Built: Wed Aug 16 21:32:36 2023
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: 1.7.2
GitCommit:
runc:
Version: 1.1.7-0ubuntu2.2
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
└─ % docker buildx version
docker: 'buildx' is not a docker command.
See 'docker --help'
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.
on macos you'll need the docker-buildx
package (it's a plugin -- that's usually shipped with core but is separate for some reason there)
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.
Ah yeah it's installable, but it means the change will become breaking even for current docker installs. I am totally fine with that though.
Let me know if you want me to change the code and drop the old pull/push method.
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.
yeah I think it's reasonable -- arguably the non-buildx behaviour is broken
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.
Updated 👍
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.
When availableUses docker buildkit to copy images, this also handles multi arch images correctly. Docker publishes without buildkit installed will fail now.Fixes: #541