mutate

package
v0.0.0-...-0cfc503 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package mutate provides facilities for mutating v1.Images of any kind.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(base v1.Image, adds ...Addendum) (v1.Image, error)

Append will apply the list of addendums to the base image

func AppendLayers

func AppendLayers(base v1.Image, layers ...v1.Layer) (v1.Image, error)

AppendLayers applies layers to a base image

func Canonical

func Canonical(img v1.Image) (v1.Image, error)

Canonical is a helper function to combine Time and configFile to remove any randomness during a docker build.

func Config

func Config(base v1.Image, cfg v1.Config) (v1.Image, error)

Config mutates the provided v1.Image to have the provided v1.Config

func ConfigFile

func ConfigFile(base v1.Image, cfg *v1.ConfigFile) (v1.Image, error)

ConfigFile mutates the provided v1.Image to have the provided v1.ConfigFile

func CreatedAt

func CreatedAt(base v1.Image, created v1.Time) (v1.Image, error)

CreatedAt mutates the provided v1.Image to have the provided v1.Time

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

func Rebase

func Rebase(orig, oldBase, newBase v1.Image) (v1.Image, error)

Rebase returns a new v1.Image where the oldBase in orig is replaced by newBase.

func Time

func Time(img v1.Image, t time.Time) (v1.Image, error)

Time sets all timestamps in an image to the given timestamp.

Types

type Addendum

type Addendum struct {
	Layer   v1.Layer
	History v1.History
}

Addendum contains layers and history to be appended to a base image

Jump to

Keyboard shortcuts

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