cli icon indicating copy to clipboard operation
cli copied to clipboard

Add support for multiple platform options in image load and save

Open ctalledo opened this issue 5 months ago • 1 comments

- What I did

Prior to this change, docker image load and docker image save accept only a single platform via the --platform option.

This change adds support for multiple platforms using a comma-separated list passed to --platform. E.g.:

docker image save --platform linux/amd64,linux/arm64/v8 -o b.tar busybox:latest
docker image load --platform linux/amd64,linux/arm64/v8 -i b.tar

** NOTE **: Depends on the corresponding change in the Moby engine (see https://github.com/moby/moby/pull/50166).

- How I did it

Updated the --platform option in the image load and image save commands to accept an array of platforms, as opposed to a single platform.

- How to verify it

Run updated unit tests.

- Human readable description for the release notes

* Updated `docker image load|save` to accept multiple platforms via the `--platform` option, using a comma separated list (e.g., `docker image load --platform linux/amd64,linux/arm64/v8`).

- A picture of a cute animal (not mandatory but encouraged)

ctalledo avatar Jun 10 '25 23:06 ctalledo

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 55.05%. Comparing base (8b8f558) to head (0ba4362).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6126      +/-   ##
==========================================
+ Coverage   55.02%   55.05%   +0.03%     
==========================================
  Files         361      361              
  Lines       30152    30161       +9     
==========================================
+ Hits        16591    16605      +14     
+ Misses      12604    12598       -6     
- Partials      957      958       +1     
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar Jun 10 '25 23:06 codecov-commenter

FWIW; I had a "wip" branch to implement a multi-platform option, but it still needs some work (and a decision where we want to put it);

  • https://github.com/docker/cli/pull/6166

thaJeztah avatar Jul 22 '25 13:07 thaJeztah

Changed the changelog a bit, let me know if that looks good.

cc @ArthurFlag

vvoland avatar Jul 23 '25 10:07 vvoland

Changed the changelog a bit, let me know if that looks good.

Thanks @vvoland, LGTM.

ctalledo avatar Jul 23 '25 16:07 ctalledo