module V1::Mutate
Overview
Module provides facilities for mutating v1.Images of any kind.
Extended Modules
Defined in:
v1/mutate/image.crv1/mutate/mutate.cr
v1/mutate/rebase.cr
Constant Summary
-
WHITEOUT_PREFIX =
".wh."
Instance Method Summary
-
#append(base : V1::Image, adds : Array(Addendum))
append will apply the list of Addendum to the base image
-
#append_layers(base : V1::Image, layers : Array(V1::Layer))
append_layers applies layers to a base image
-
#canonical(img : V1::Image)
canonical is a helper function to combine Time and configFile to remove any randomness during a docker build.
-
#config(base : V1::Image, cfg : V1::Config)
config mutates the provided V1::Image to have the provided V1::Config
-
#config_file(base : V1::Image, cfg : V1::ConfigFile)
config_file mutates the provided V1::Image to have the provided V1::ConfigFile
-
#created_at(base : V1::Image, created : Time)
created_at mutates the provided V1::Image to have the provided Time
- #extract(img : V1::Image, w : IO) : Nil
-
#extract(img : V1::Image)
extract takes an image and returns an io.ReadCloser containing the image's flattened filesystem.
- #in_whiteout_dir(map : ::Hash(String, Bool), file : String)
- #layer_time(layer : V1::Layer, t : Time)
-
#rebase(orig : V1::Image, old_base : V1::Image, new_base : V1::Image)
rebase returns a new V1::Image where the old_base in orig is replaced by new_base
-
#time(img : V1::Image, t : Time)
time sets all timestamps in an image to the given timestamp.
- #validate(adds : Array(Addendum)) : Nil
Instance Method Detail
append will apply the list of Addendum to the base image
append_layers applies layers to a base image
canonical is a helper function to combine Time and configFile to remove any randomness during a docker build.
config mutates the provided V1::Image to have the provided V1::Config
config_file mutates the provided V1::Image to have the provided V1::ConfigFile
created_at mutates the provided V1::Image to have the provided Time
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 Crystar::Reader, 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
rebase returns a new V1::Image where the old_base in orig is replaced by new_base
time sets all timestamps in an image to the given timestamp.