Files
moby/client/image_create_opts.go
Sebastiaan van Stijn 137adde33d client: prepare option-structs for multiple platforms
Some methods currently support a single platform only, but we may
be able to support multiple platforms.

This patch prepares the option-structs for multi-platform support,
but (for now) returning an error if multiple options are provided.

We need a similar check on the daemon-side, but still need to check
on the client, as older daemons will ignore multiple platforms, which
may be unexpected.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-30 18:04:34 +01:00

22 lines
643 B
Go

package client
import (
"io"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
)
// ImageCreateOptions holds information to create images.
type ImageCreateOptions struct {
RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry.
// Platforms specifies the platforms to platform of the image if it needs
// to be pulled from the registry. Multiple platforms can be provided
// if the daemon supports multi-platform pulls.
Platforms []ocispec.Platform
}
// ImageCreateResult holds the response body returned by the daemon for image create.
type ImageCreateResult struct {
Body io.ReadCloser
}