ociutil

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package ociutil provides shared helpers for OCI registry operations.

Index

Constants

View Source
const (
	DockerMediaTypeManifest     = "application/vnd.docker.distribution.manifest.v2+json"
	DockerMediaTypeManifestList = "application/vnd.docker.distribution.manifest.list.v2+json"
	DockerMediaTypeConfig       = "application/vnd.docker.container.image.v1+json"
	DockerMediaTypeLayer        = "application/vnd.docker.image.rootfs.diff.tar"
	DockerMediaTypeLayerGzip    = "application/vnd.docker.image.rootfs.diff.tar.gzip"
	DockerMediaTypeForeignLayer = "application/vnd.docker.image.rootfs.foreign.diff.tar.gzip"
)

Docker V2 media types that are structurally compatible with OCI equivalents.

Variables

This section is empty.

Functions

func ConfigurePlainHTTP

func ConfigurePlainHTTP(repo *remote.Repository)

ConfigurePlainHTTP sets PlainHTTP on the repository when the registry host is a loopback address (localhost, 127.0.0.1, [::1]) or a private IP (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16). These registries almost never serve TLS and defaulting to HTTPS causes "http: server gave HTTP response to HTTPS client" errors.

func ConvertDockerMediaTypes

func ConvertDockerMediaTypes(m *ispec.Manifest)

ConvertDockerMediaTypes rewrites Docker V2 media types in a manifest to their OCI equivalents in-place. Docker V2 and OCI blobs are structurally identical; only the MIME types differ. umoci's UnpackRootfs strictly checks for OCI media types, so this conversion is required when pulling images produced by `docker build`.

func RegisterDockerParsers

func RegisterDockerParsers()

RegisterDockerParsers registers umoci media-type parsers for Docker V2 media types so that umoci's FromDescriptor returns parsed Go structs (ispec.Manifest, ispec.Index, ispec.Image) instead of raw readers.

Docker V2 manifests and manifest lists are structurally compatible with their OCI counterparts, so simple JSON decoding into the OCI types is sufficient.

This function is safe to call multiple times; registration happens only once.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL