docker_image

package
v0.0.0-...-841f565 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const Type = "docker_image"

Type is the string value of the Target type

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Target   *Target
	Artifact *Artifact
	Client   container.Docker
	KVStore  kv.Storage
	Logger   logz.FieldLogger
}

Action is the executor for building a docker image

func (Action) Execute

func (a Action) Execute(ctx context.Context) (err error)

Execute runs the action and produces a docker_image.Artifact

func (*Action) UseDockerClient

func (a *Action) UseDockerClient(client container.Docker)

UseDockerClient sets this Action container.Docker client

func (*Action) UseKVStorage

func (a *Action) UseKVStorage(client kv.Storage)

UseKVStorage allows the KV Storage client to be injected into the target's action

func (*Action) UseLogger

func (a *Action) UseLogger(logger logz.FieldLogger)

UseLogger injects a logger into the target's action

type Artifact

type Artifact struct {
	ark.RawArtifact `mapstructure:",squash"`
	URL             string           `json:"url" mapstructure:"url"`
	Client          container.Docker `json:"-" mapstructure:"-"`
}

Artifact is the result of a successful actions.BuildDockerImage

func (Artifact) Cacheable

func (a Artifact) Cacheable() bool

Cacheable always returns true because docker image may be stored remotely and locally

func (Artifact) LocallyCached

func (a Artifact) LocallyCached(ctx context.Context) (bool, error)

LocallyCached determines if the image exists in the local docker registry by its URL

func (Artifact) Pull

func (a Artifact) Pull(ctx context.Context) error

Pull attempts to pull the docker image from the remote registry by its URL

func (Artifact) Push

func (a Artifact) Push(ctx context.Context) error

Push attempts to upload the docker image to the remote registry by its URL

func (Artifact) RemotelyCached

func (a Artifact) RemotelyCached(ctx context.Context) (bool, error)

RemotelyCached determines if the image exists in the remote repository by its URL

func (*Artifact) UseDockerClient

func (a *Artifact) UseDockerClient(client container.Docker)

UseDockerClient sets this Artifact container.Docker client

type Target

type Target struct {
	ark.RawTarget              `mapstructure:",squash"`
	Repo                       string             `json:"repo" mapstructure:"repo"`
	Dockerfile                 string             `json:"dockerfile" mapstructure:"dockerfile"`
	Secrets                    []string           `json:"secrets" mapstructure:"secrets"`
	DisableEntrypointInjection bool               `json:"disableEntrypointInjection" mapstructure:"disableEntrypointInjection"`
	CacheInline                bool               `json:"cacheInline" mapstructure:"cacheInline"`
	BuildArgs                  map[string]*string `json:"BuildArgs" mapstructure:"buildArgs"`
	Output                     string             `json:"output" mapstructure:"output"`
	CacheFrom                  []string           `json:"cacheFrom" mapstructure:"cacheFrom"`
}

Target expresses intention to build a docker image

func (Target) Produce

func (t Target) Produce(checksum hash.Hash) (ark.Artifact, error)

Produce should produce a deterministic docker image artifact

func (*Target) Validate

func (t *Target) Validate() error

Validate checks if the Target fields are valid

Jump to

Keyboard shortcuts

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