module V1::Mutate

Overview

Module provides facilities for mutating v1.Images of any kind.

Extended Modules

Defined in:

v1/mutate/image.cr
v1/mutate/mutate.cr
v1/mutate/rebase.cr

Constant Summary

WHITEOUT_PREFIX = ".wh."

Instance Method Summary

Instance Method Detail

def append(base : V1::Image, adds : Array(Addendum)) #

append will apply the list of Addendum to the base image


[View source]
def append_layers(base : V1::Image, layers : Array(V1::Layer)) #

append_layers applies layers to a base image


[View source]
def canonical(img : V1::Image) #

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


[View source]
def config(base : V1::Image, cfg : V1::Config) #

config mutates the provided V1::Image to have the provided V1::Config


[View source]
def config_file(base : V1::Image, cfg : V1::ConfigFile) #

config_file mutates the provided V1::Image to have the provided V1::ConfigFile


[View source]
def created_at(base : V1::Image, created : Time) #

created_at mutates the provided V1::Image to have the provided Time


[View source]
def extract(img : V1::Image, w : IO) : Nil #

[View source]
def extract(img : V1::Image) #

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


[View source]
def in_whiteout_dir(map : ::Hash(String, Bool), file : String) #

[View source]
def layer_time(layer : V1::Layer, t : Time) #

[View source]
def 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


[View source]
def time(img : V1::Image, t : Time) #

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


[View source]
def validate(adds : Array(Addendum)) : Nil #

[View source]