package ocipush

import "github.com/docker/compose/v2/internal/ocipush"

Index

Constants

const (
	// ComposeProjectArtifactType is the OCI 1.1-compliant artifact type value
	// for the generated image manifest.
	ComposeProjectArtifactType = "application/vnd.docker.compose.project"
	// ComposeYAMLMediaType is the media type for each layer (Compose file)
	// in the image manifest.
	ComposeYAMLMediaType = "application/vnd.docker.compose.file+yaml"
	// ComposeEmptyConfigMediaType is a media type used for the config descriptor
	// when doing OCI 1.0-style pushes.
	//
	// The content is always `{}`, the same as a normal empty descriptor, but
	// the specific media type allows clients to fall back to the config media
	// type to recognize the manifest as a Compose project since the artifact
	// type field is not available in OCI 1.0.
	//
	// This is based on guidance from the OCI 1.1 spec:
	//	> Implementers note: artifacts have historically been created without
	// 	> an artifactType field, and tooling to work with artifacts should
	//	> fallback to the config.mediaType value.
	ComposeEmptyConfigMediaType = "application/vnd.docker.compose.config.empty.v1+json"
	// ComposeEnvFileMediaType is the media type for each Env File layer in the image manifest.
	ComposeEnvFileMediaType = "application/vnd.docker.compose.envfile"
)

Functions

func DescriptorForComposeFile

func DescriptorForComposeFile(path string, content []byte) v1.Descriptor

func DescriptorForEnvFile

func DescriptorForEnvFile(path string, content []byte) v1.Descriptor

func PushManifest

func PushManifest(
	ctx context.Context,
	resolver *imagetools.Resolver,
	named reference.Named,
	layers []Pushable,
	ociVersion api.OCIVersion,
) error

Types

type Pushable

type Pushable struct {
	Descriptor v1.Descriptor
	Data       []byte
}

Source Files

push.go

Version
v2.35.1 (latest)
Published
Apr 17, 2025
Platform
linux/amd64
Imports
14 packages
Last checked
3 hours ago

Tools for package owners.