mod

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: Apache-2.0 Imports: 22 Imported by: 3

Documentation

Overview

Package mod changes an image according to the requested modifications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(ctx context.Context, rc *regclient.RegClient, r ref.Ref, opts ...Opts) (ref.Ref, error)

Apply applies a set of modifications to an image (manifest, configs, and layers)

Types

type Opts

type Opts func(*dagConfig)

Opts defines options for Apply

func WithAnnotation

func WithAnnotation(name, value string) Opts

WithAnnotation adds an annotation, or deletes it if the value is set to an empty string

func WithAnnotationOCIBase

func WithAnnotationOCIBase(rBase ref.Ref, dBase digest.Digest) Opts

WithAnnotationOCIBase adds annotations for the base image

func WithBuildArgRm added in v0.4.2

func WithBuildArgRm(arg string, value *regexp.Regexp) Opts

WithBuildArgRm removes a build arg from the config history

func WithConfigTimestampFromLabel

func WithConfigTimestampFromLabel(label string) Opts

WithConfigTimestampFromLabel sets the max timestamp in the config to match a label value

func WithConfigTimestampMax

func WithConfigTimestampMax(t time.Time) Opts

WithConfigTimestampMax sets the max timestamp on any config objects

func WithData

func WithData(maxDataSize int64) Opts

WithData sets the descriptor data field max size. This also strips the data field off descriptors above the max size.

func WithExposeAdd

func WithExposeAdd(port string) Opts

WithExposeAdd defines an exposed port in the image config

func WithExposeRm

func WithExposeRm(port string) Opts

WithExposeRm deletes an exposed from the image config

func WithLabel

func WithLabel(name, value string) Opts

WithLabel sets or deletes a label from the image config

func WithLabelToAnnotation

func WithLabelToAnnotation() Opts

WithLabelToAnnotation copies image config labels to manifest annotations

func WithLayerRmCreatedBy

func WithLayerRmCreatedBy(re regexp.Regexp) Opts

WithLayerRmCreatedBy deletes a layer based on a regex of the created by field in the config history for that layer

func WithLayerRmIndex

func WithLayerRmIndex(index int) Opts

WithLayerRmIndex deletes a layer by index. The index starts at 0.

func WithLayerStripFile

func WithLayerStripFile(file string) Opts

WithLayerStripFile removes a file from within the layer tar

func WithLayerTimestampFromLabel

func WithLayerTimestampFromLabel(label string) Opts

WithLayerTimestampFromLabel sets the max layer timestamp based on a label in the image

func WithLayerTimestampMax

func WithLayerTimestampMax(t time.Time) Opts

WithLayerTimestampMax ensures no file timestamps are after specified time

func WithManifestToOCI

func WithManifestToOCI() Opts

WithManifestToOCI converts the manifest to OCI media types

func WithVolumeAdd

func WithVolumeAdd(volume string) Opts

WithVolumeAdd defines a volume in the image config

func WithVolumeRm

func WithVolumeRm(volume string) Opts

WithVolumeRm deletes a volume from the image config

Jump to

Keyboard shortcuts

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