Documentation ¶
Overview ¶
Package mutate provides facilities for mutating v1.Images of any kind.
Index ¶
- func Append(base v1.Image, adds ...Addendum) (v1.Image, error)
- func AppendLayers(base v1.Image, layers ...v1.Layer) (v1.Image, error)
- func Canonical(img v1.Image) (v1.Image, error)
- func Config(base v1.Image, cfg v1.Config) (v1.Image, error)
- func CreatedAt(base v1.Image, created v1.Time) (v1.Image, error)
- func Extract(img v1.Image) io.ReadCloser
- func Rebase(orig, oldBase, newBase v1.Image) (v1.Image, error)
- func Time(img v1.Image, t time.Time) (v1.Image, error)
- type Addendum
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendLayers ¶
AppendLayers applies layers to a base image
func Canonical ¶
Canonical is a helper function to combine Time and configFile to remove any randomness during a docker build.
func Extract ¶
func Extract(img v1.Image) io.ReadCloser
Extract takes an image and returns an io.ReadCloser containing the image's flattened filesystem.
Callers can read the filesystem contents by passing the reader to tar.NewReader, or io.Copy it directly to some output.
If a caller doesn't read the full contents, they should Close it to free up resources used during extraction.
Adapted from https://github.com/google/containerregistry/blob/master/client/v2_2/docker_image_.py#L731