Documentation
¶
Index ¶
- func ExportImage(ctx context.Context, imageRef, destDir, platform string) ([]ocispec.Descriptor, []byte, []byte, error)
- func ImportImage(ctx context.Context, srcDir string, imageRef string) error
- func LocalPlatforms(ctx context.Context, imageRef string) ([]string, error)
- func ParseManifest(data []byte) (ocispec.Manifest, error)
- func ParsePlatform(s string) (ocispec.Platform, error)
- func PlatformString(p ocispec.Platform) string
- func SerializeManifest(m ocispec.Manifest) ([]byte, error)
- func WriteOCILayout(dir string, manifestBytes []byte, configBytes []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportImage ¶
func ExportImage(ctx context.Context, imageRef, destDir, platform string) ([]ocispec.Descriptor, []byte, []byte, error)
ExportImage exports one platform of a Docker image to an OCI layout directory. Returns layer descriptors, manifest bytes, and config bytes.
platform selects which one when the daemon holds several; empty means let the daemon choose, which is what it did before this was selectable.
func ImportImage ¶
ImportImage loads an OCI image from a local directory into the Docker daemon. It creates a Docker-compatible tar from the OCI layout and calls docker load.
func LocalPlatforms ¶
LocalPlatforms reports the platforms of imageRef that the daemon actually holds, as "os/arch" or "os/arch/variant".
It returns nil when the daemon has no per-platform view of the image, which is the normal case: the classic image store keeps one platform per tag, and only the containerd image store can hold several. Attestation manifests are excluded — buildx attaches SBOM and provenance as manifests with platform "unknown/unknown", and publishing those as platforms would be nonsense.
func ParseManifest ¶
ParseManifest parses raw JSON bytes into an OCI Manifest.
func ParsePlatform ¶
ParsePlatform turns "linux/arm64" or "linux/arm/v7" into an OCI platform.
func PlatformString ¶
PlatformString renders an OCI platform the way the CLI accepts it.
func SerializeManifest ¶
SerializeManifest serializes an OCI Manifest to JSON bytes.
Types ¶
This section is empty.