build

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

Documentation

Index

Constants

View Source
const (
	ARK_LLB_FILE     = "__ark.llb"
	ARK_CONTEXT_FILE = "context.tar.gz"
)

Variables

View Source
var (
	BUILDKIT_INLINE_CACHE = "1"
)

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
	BuildArgs                  map[string]*string `hcl:"build_args,optional"`
	Target                     string             `hcl:"target,optional"`
	Output                     string             `hcl:"output,optional"`
	DumpContext                bool               `hcl:"dump_context,optional"`
	Tags                       []string           `hcl:"tags,optional"`
	CacheFrom                  []string           `hcl:"cache_from,optional"`
	CacheInline                bool               `hcl:"cache_inline,optional"`
	Secrets                    map[string]string  `hcl:"secrets,optional"` // formatted as secretID: vaultPath
	DisableEntrypointInjection bool               `hcl:"disable_entrypoint_injection,optional"`
}

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
	BuildArgs                  hcl.Expression `hcl:"build_args,optional"`
	Target                     hcl.Expression `hcl:"target,optional"`
	Tags                       hcl.Expression `hcl:"tags,attr"`
	Output                     hcl.Expression `hcl:"output,attr"`
	DumpContext                hcl.Expression `hcl:"dump_context,attr"`
	CacheInline                hcl.Expression `hcl:"cache_inline,optional"`
	CacheFrom                  hcl.Expression `hcl:"cache_from,optional"`
	Secrets                    hcl.Expression `hcl:"secrets,optional"`
	DisableEntrypointInjection hcl.Expression `hcl:"disable_entrypoint_injection,optional"`
}

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 image 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