Skip to content

Add platform option to docker_image_export and docker_image_load #1064

Open
@AnthonyGrondin

Description

@AnthonyGrondin
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    docker-plainplain Docker (no swarm, no compose, no stack)enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions