-
-
Notifications
You must be signed in to change notification settings - Fork 1k
feat(docker/v2): initial implementation #5793
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
Conversation
Deploying goreleaser with
|
Latest commit: |
ddae597
|
Status: | ✅ Deploy successful! |
Preview URL: | https://4faac312.goreleaser.pages.dev |
Branch Preview URL: | https://docker-v2.goreleaser.pages.dev |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5793 +/- ##
=======================================
Coverage ? 82.75%
=======================================
Files ? 167
Lines ? 16932
Branches ? 0
=======================================
Hits ? 14012
Misses ? 2314
Partials ? 606 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
@@ -1054,6 +1056,20 @@ type DockerManifest struct { | |||
Retry Retry `yaml:"retry,omitempty" json:"retry,omitempty"` | |||
} | |||
|
|||
// DockerV2 is the new Docker build pipe options. | |||
type DockerV2 struct { |
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.
Any reason for not exposing build_flag_templates
?
Use-cases are --build-context
, --cache-from
, --cache-to
, --no-cache
.
Not sure if it worth to expose each single CLI options. Something like extra_args
for advanced usage would be great.
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 we can add the flags yes
will probably do in a subsequent PR
|
||
## Setting up a builder | ||
|
||
For buildx to work, you'll need to have a builder that supports multi-platform |
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.
Note sure, if you would like to mention
https://github.com/docker/setup-buildx-action
for GHA as well.
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.
good catch! We should probably have a complete actions example
Feel free to suggest improvements | ||
[here](https://github.com/orgs/goreleaser/discussions/6005). |
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 about having a push option, which has the value push: {{ not .IsSnapshot }}
by default. If an end-user really wants to have usage images from a snapshot build, he can opt-in. He also can use templated image_templates
to configure different push location.
My use case here: I'm running --snapshot
on main branches and I would like to push the main branch to the main
tag. Thats one way, how I can quickly get feedback from reporters without publish a full 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.
That's the use case for nightly builds... if we allow to pass random flags, though, you could still pass a {{ if .IsSnapshot }}--push{{ end }}
then 🤔
|
||
The build context itself is a temporary directory which contains the binaries | ||
and packages for the target platforms, which you can `COPY` into your image | ||
(mind the use of `$TARGETPLATFORM` above). |
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.
Great Idea!
needs #5793 Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
needs #5793 Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
needs #5793 Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
needs #5793 Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
For teams that only use Go Releaser to build artifacts (and not to publish them), will this switch to This is how we currently build artifacts. goreleaser release --clean --skip=validate,publish |
Hmmm this might need some extra work - can you open an issue for this particular case? If you run with --snapshot it will create the local images btw, but with skip publish it won't |
This is the v2 of the docker feature!
So now, what happens:
--snapshot
, it'll build the manifest, but not push it (only useful to test the actual docker image build, not the image itself)docker buildx build
to build and publish the manifest + SBOMdocker_signs
should still workdocker_digests
should still workDiscussion for after the merge: https://github.com/orgs/goreleaser/discussions/6005
TODO from the top of my head:
pro: split/merge wiring1closes #5733
Footnotes
Not really needed, will only run in publish, which runs in the merging step. ↩