package bake

import "github.com/docker/buildx/bake"

Index

Functions

func ReadTargets

func ReadTargets(ctx context.Context, files, targets, overrides []string) (map[string]*Target, error)

func TargetsToBuildOpt

func TargetsToBuildOpt(m map[string]*Target) (map[string]build.Options, error)

Types

type Config

type Config struct {
	Variables []*Variable `json:"-" hcl:"variable,block"`
	Groups    []*Group    `json:"groups" hcl:"group,block"`
	Targets   []*Target   `json:"targets" hcl:"target,block"`
	Remain    hcl.Body    `json:"-" hcl:",remain"`
}

func ParseCompose

func ParseCompose(dt []byte) (*Config, error)

func ParseFile

func ParseFile(fn string) (*Config, error)

func ParseHCL

func ParseHCL(dt []byte, fn string) (*Config, error)

func (Config) ResolveGroup

func (c Config) ResolveGroup(name string) []string

func (Config) ResolveTarget

func (c Config) ResolveTarget(name string, overrides map[string]*Target) (*Target, error)

type Group

type Group struct {
	Name    string   `json:"-" hcl:"name,label"`
	Targets []string `json:"targets" hcl:"targets"`
}

type Target

type Target struct {
	Name string `json:"-" hcl:"name,label"`

	// Inherits is the only field that cannot be overridden with --set
	Inherits []string `json:"inherits,omitempty" hcl:"inherits,optional"`

	Context    *string           `json:"context,omitempty" hcl:"context,optional"`
	Dockerfile *string           `json:"dockerfile,omitempty" hcl:"dockerfile,optional"`
	Args       map[string]string `json:"args,omitempty" hcl:"args,optional"`
	Labels     map[string]string `json:"labels,omitempty" hcl:"labels,optional"`
	Tags       []string          `json:"tags,omitempty" hcl:"tags,optional"`
	CacheFrom  []string          `json:"cache-from,omitempty"  hcl:"cache-from,optional"`
	CacheTo    []string          `json:"cache-to,omitempty"  hcl:"cache-to,optional"`
	Target     *string           `json:"target,omitempty" hcl:"target,optional"`
	Secrets    []string          `json:"secret,omitempty" hcl:"secret,optional"`
	SSH        []string          `json:"ssh,omitempty" hcl:"ssh,optional"`
	Platforms  []string          `json:"platforms,omitempty" hcl:"platforms,optional"`
	Outputs    []string          `json:"output,omitempty" hcl:"output,optional"`
	Pull       *bool             `json:"pull,omitempty" hcl:"pull,optional"`
	NoCache    *bool             `json:"no-cache,omitempty" hcl:"no-cache,optional"`
}

type Variable

type Variable struct {
	Name    string `json:"-" hcl:"name,label"`
	Default string `json:"default,omitempty" hcl:"default,optional"`
}

Source Files

bake.go compose.go hcl.go

Version
v0.4.1
Published
Apr 30, 2020
Platform
js/wasm
Imports
22 packages
Last checked
7 hours ago

Tools for package owners.