Description
SUMMARY
Since API 1.48+ docker allows passing in the --platform
flag when loading a docker image from a .tar archive file, to only load a specific platform.
Example:
docker image load -i image.tar --platform=linux/amd64
The command also fails, if the user attempts to load a platform that is not present in the archive. This should be helpful, to prevent a playbook from loading an invalid image for a given platform.
In the same manner, also added in 1.48+ docker CLI allows passing the --platform
flag when invoking docker save, to create an archive with only the selected platform variant.
Example:
docker image save --platform=linux/riscv64 -o alpine-riscv.tar alpine:latest
So in TL;DR, the platform
option should be added to both docker_image_export
and docker_image_load
, to allows platform filtering and unlock more functionalities from the docker CLI, such as making sure a playbook never exports / load an invalid image for a given platform.
ISSUE TYPE
- Feature Idea
COMPONENT NAME
- docker_image_export
- docker_image_load
ADDITIONAL INFORMATION
- Related issue: Add 'platform' option when pulling in docker_image #79