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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComputedAttrs

type ComputedAttrs struct {
	Repo          string             `hcl:"repo,attr"`
	Dockerfile    string             `hcl:"dockerfile,attr"` // Has to be relative to the repo/workspace root
	DockerContext *string            `hcl:"context,attr"`
	BuildArgs     *map[string]string `hcl:"build_args,attr"`
	Tags          *[]string          `hcl:"tags,attr"`
	Output        *string            `hcl:"output,attr"`
	Progress      *string            `hcl:"progress,attr"`
}

ComputedAttrs used to store the computed attributes of a docker_image target

type Target

type Target struct {
	*base.RawTarget `json:"-"`

	Repo          hcl.Expression `hcl:"repo,attr"`
	Dockerfile    hcl.Expression `hcl:"dockerfile,attr"` // Has to be relative to the repo/workspace root
	DockerContext hcl.Expression `hcl:"context,attr"`
	BuildArgs     hcl.Expression `hcl:"build_args,attr"`
	Tags          hcl.Expression `hcl:"tags,attr"`
	Output        hcl.Expression `hcl:"output,attr"`
	Progress      hcl.Expression `hcl:"progress,attr"`
}

Target defines the required and optional attributes for defining a Docker Image Build

func (Target) Attributes

func (t Target) Attributes() map[string]cty.Value

Attributes return combined rawTarget.Attributes with typedTarget.Attributes.

func (Target) Build

func (t Target) Build() error

Build constructs a Docker image from the information provided in the docker_image target

func (Target) CheckLocalBuildCache

func (t Target) CheckLocalBuildCache() (bool, error)

CheckLocalBuildCache loads the build cache state and verifies that the hashes match

func (Target) CheckRemoteCache

func (t Target) CheckRemoteCache() (bool, error)

CheckRemoteCache determines whether a docker image for a given target exists in a remote repository

func (Target) ComputedAttrs

func (t Target) ComputedAttrs() *ComputedAttrs

ComputedAttrs returns a pointer to computed attributes from the state store. If attributes are not in the state store it will create a new pointer and insert it into the state store.

func (Target) PreBuild

func (t Target) PreBuild() error

PreBuild a lifecycle hook for calculating state before the build

func (Target) PullRemoteCache

func (t Target) PullRemoteCache() error

PullRemoteCache pulls a docker iamge from a remote repository that matches a target's state hash

func (Target) PushRemoteCache

func (t Target) PushRemoteCache() error

PushRemoteCache pushes a state artifact to remote storage and pushes a docker image to a remote repository

func (Target) URL

func (t Target) URL(tag string) string

URL constructs an image URL from the repo and a given tag

func (Target) URLsFromTags

func (t Target) URLsFromTags() []string

URLsFromTags creates a slice of image URLs

Jump to

Keyboard shortcuts

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