-
Notifications
You must be signed in to change notification settings - Fork 2k
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
push: Don't default to DOCKER_DEFAULT_PLATFORM
, improve message
#5246
Conversation
2a202d5
to
8e8a308
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5246 +/- ##
==========================================
- Coverage 61.48% 61.46% -0.02%
==========================================
Files 298 298
Lines 20811 20820 +9
==========================================
+ Hits 12795 12798 +3
- Misses 7103 7110 +7
+ Partials 913 912 -1 |
cli/command/image/push.go
Outdated
@@ -81,7 +88,7 @@ func RunPush(ctx context.Context, dockerCli command.Cli, opts pushOptions) error | |||
|
|||
printNote(dockerCli, `Selecting a single platform will only push one matching image manifest from a multi-platform image index. | |||
This means that any other components attached to the multi-platform image index (like Buildkit attestations) won't be pushed. | |||
If you want to only push a single platform image while preserving the attestations, please use 'docker convert\n' | |||
If you want to push a whole multi-platform image, make sure all image content is present and remove the --platform flag. |
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.
nit: i'd remove whole
here.
Also, what does make sure all image content is present
mean in this scenario? it's a bit confusing to me
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.
You can have a multi-platform image, but only have partial content available.
For example, busybox
is a multi-platform image, but doing docker pull busybox
will only fetch the content for your daemon's host platform, assuming that the host is linux/amd64
:
$ docker pull busybox
$ docker pull --platform linux/arm64 busybox
Will pull the content for linux/amd64
and linux/arm64
, but the "full" busybox
image index still references all the other supported platforms (s390x
, riscv64
, arm/v5
, ...).
Retagging the busybox as-is and attempting to push it to a different repository in most cases will fail, because the index will reference unknown blobs (of other platforms).
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.
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 don't really understand what this note is trying to convey. Is it supposed to be a warning? When I read this it feels like I am doing something wrong. But we're not exactly saying that.
Can we clarify somehow?
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.
You can have a multi-platform image, but only have partial content available.
For example,
busybox
is a multi-platform image, but doingdocker pull busybox
will only fetch the content for your daemon's host platform, assuming that the host islinux/amd64
:$ docker pull busybox $ docker pull --platform linux/arm64 busybox
Will pull the content for
linux/amd64
andlinux/arm64
, but the "full"busybox
image index still references all the other supported platforms (s390x
,riscv64
,arm/v5
, ...).Retagging the busybox as-is and attempting to push it to a different repository in most cases will fail, because the index will reference unknown blobs (of other platforms).
Thanks for that explanation @vvoland, makes sense.
I'm not convinced the terminology we're using is the clearest for the users though (when i hear image content i do not think about architectural variants, but the actual contents of the image - files etc.), but i can't think of many suggestions right now. Where else in the docs do we speak of these things? Do we use "content" with the same meaning in those places?
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.
Applied some suggestions from @dvdksn and @jalonsogo.
Ran it through a bunch of different themes:
a.mp4
8e8a308
to
0915c28
Compare
0915c28
to
363e037
Compare
Signed-off-by: Paweł Gronowski <[email protected]>
It's not merged yet. Signed-off-by: Paweł Gronowski <[email protected]>
363e037
to
d401994
Compare
e0ca02d
to
9ae5a8e
Compare
DOCKER_DEFAULT_PLATFORM
on older APIsDOCKER_DEFAULT_PLATFORM
, improve message
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.
LGTM
cli/command/image/push.go
Outdated
`Push a platform-specific manifest as a single-platform image to the registry. | ||
Image index won't be pushed, meaning that other manifests, including attestations will be lost. |
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.
The only part here that could still be ambiguous is "will be lost"; or at least; it will be still there, but won't be pushed.
I guess we can still tweak in follow-ups
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.
Changed will be lost
to won't be preserved
, WDYT?
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.
LGTM
9ae5a8e
to
7320062
Compare
Signed-off-by: Paweł Gronowski <[email protected]>
7320062
to
6c04adc
Compare
Thanks! |
Don't default the value of
--platform
flag toDOCKER_DEFAULT_PLATFORM
environment variable and adjust the note.- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)