package tarball

import "github.com/google/go-containerregistry/pkg/legacy/tarball"

Package tarball provides facilities for writing v1 docker images (https://github.com/moby/moby/blob/master/image/spec/v1.md) from/to a tarball on-disk.

Index

Functions

func MultiWrite

func MultiWrite(refToImage map[name.Reference]v1.Image, w io.Writer) error

MultiWrite writes the contents of each image to the provided reader, in the V1 image tarball format. The contents are written in the following format: One manifest.json file at the top level containing information about several images. One repositories file mapping from the image <registry>/<repo name> to <tag> to the id of the top most layer. For every layer, a directory named with the layer ID is created with the following contents:

layer.tar - The uncompressed layer tarball.
<layer id>.json- Layer metadata json.
VERSION- Schema version string. Always set to "1.0".

One file for the config blob, named after its SHA.

func Write

func Write(ref name.Reference, img v1.Image, w io.Writer) error

Write is a wrapper to write a single image in V1 format and tag to a tarball.

Source Files

doc.go write.go

Version
v0.20.3 (latest)
Published
Jan 15, 2025
Platform
linux/amd64
Imports
12 packages
Last checked
19 hours ago

Tools for package owners.