kaniko/vendor/github.com/google/go-containerregistry/pkg/v1/mutate
Joël Pepper 0cbb7664de
fix(executor): make pax tar builds reproducible again (#2384)
In v1.8.0 (commit 7410007) kaniko switched to using the pax tar header
format for compressing image layers, since this format allows for greater
precision in recording timestamps, however this inadvertendly broke the
"--reproducible" functionality, due to an bug in the underlying
go-containerregistry dependency which did not set the additional
timestamps in the pax header when canonicalizing image layers. This
oversight has since been fixed in the dependency.

This commit bumps the google/go-containerregistry dependency to the
first commit which has fixed the bug
(v0.13.1-0.20230201183932-824efc7772b0). It also bumps the version of
cloud.google.com/go/storage to v1.29.0 to be compatible with the higher
transitive dependency.
2023-03-21 18:08:29 -04:00
..
README.md Improve retry behavior for push operation (#1578) 2021-02-22 21:25:58 -08:00
doc.go dep update go-containerregistry 2018-06-03 00:59:34 +00:00
image.go fix(executor): make pax tar builds reproducible again (#2384) 2023-03-21 18:08:29 -04:00
index.go fix(executor): make pax tar builds reproducible again (#2384) 2023-03-21 18:08:29 -04:00
mutate.go fix(executor): make pax tar builds reproducible again (#2384) 2023-03-21 18:08:29 -04:00
rebase.go Bump deps (#1885) 2022-01-21 13:59:16 -05:00

README.md

mutate

GoDoc

The v1.Image, v1.ImageIndex, and v1.Layer interfaces provide only accessor methods, so they are essentially immutable. If you want to change something about them, you need to produce a new instance of that interface.

A common use case for this library is to read an image from somewhere (a source), change something about it, and write the image somewhere else (a sink).

Graphically, this looks something like:

Mutations

This is obviously not a comprehensive set of useful transformations (PRs welcome!), but a rough summary of what the mutate package currently does:

Config and ConfigFile

These allow you to change the image configuration, e.g. to change the entrypoint, environment, author, etc.

Time, Canonical, and CreatedAt

These are useful in the context of reproducible builds, where you may want to strip timestamps and other non-reproducible information.

Append, AppendLayers, and AppendManifests

These functions allow the extension of a v1.Image or v1.ImageIndex with new layers or manifests.

For constructing an image FROM scratch, see the empty package.

MediaType and IndexMediaType

Sometimes, it is necessary to change the media type of an image or index, e.g. to appease a registry with strict validation of images (looking at you, GCR).

Rebase

Rebase has its own README.

This is the underlying implementation of crane rebase.

Extract

Extract will flatten an image filesystem into a single tar stream, respecting whiteout files.

This is the underlying implementation of crane export.