-
Notifications
You must be signed in to change notification settings - Fork 2k
image rm: add --platform option #6109
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
@@ -40,6 +43,11 @@ func NewRemoveCommand(dockerCli command.Cli) *cobra.Command { | |||
flags.BoolVarP(&opts.force, "force", "f", false, "Force removal of the image") | |||
flags.BoolVar(&opts.noPrune, "no-prune", false, "Do not delete untagged parents") | |||
|
|||
// TODO(thaJeztah): create a "platforms" option for this (including validation / parsing). |
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.
Working on this as well, but we can merge those changes later.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6109 +/- ##
==========================================
- Coverage 55.04% 55.03% -0.01%
==========================================
Files 361 361
Lines 30142 30152 +10
==========================================
+ Hits 16591 16595 +4
- Misses 12594 12599 +5
- Partials 957 958 +1 🚀 New features to boost your workflow:
|
91cf9c6
to
350e90f
Compare
func NewRemoveCommand(dockerCli command.Cli) *cobra.Command { | ||
var opts removeOptions | ||
func NewRemoveCommand(dockerCLI command.Cli) *cobra.Command { | ||
var options removeOptions |
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.
FWIW; renamed this one in preparation of adding an options to the opts
package (preventing this var from shadowing the import).
479f1d7
to
e7bba37
Compare
Signed-off-by: Sebastiaan van Stijn <[email protected]>
e7bba37
to
bb0ca9f
Compare
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, thanks
FWIW (still need to write up) there may be some corner-cases to still look into for that feature; trying to remove a platform that doesn’t exist in the cache still errors, even with docker image ls --tree alpine
IMAGE ID DISK USAGE CONTENT SIZE EXTRA
alpine:latest a8560b36e8b8 37.8MB 11.2MB
├─ linux/amd64 1c4eef651f65 12.1MB 3.64MB
├─ linux/arm/v6 903bfe2ae994 0B 0B
├─ linux/arm/v7 9c2d245b3c01 0B 0B
├─ linux/arm64/v8 757d680068d7 12.8MB 3.99MB
├─ linux/386 2436f2b3b7d2 0B 0B
├─ linux/ppc64le 9ed53fd3b831 12.8MB 3.58MB
├─ linux/riscv64 1de5eb4a9a67 0B 0B
└─ linux/s390x fe0dcdd1f783 0B 0B
$ docker-linux-arm64 image rm --platform=linux/s390x --force alpine
Error response from daemon: failed to delete platform linux/s390x for image sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c: image with reference alpine:latest was found but does not provide any platform |
I'll bring this one in; the above should not be a blocker for this (we can fix / improve). |
|
- What I did
- How I did it
- How to verify it
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)