imagebuilder

package
v0.0.0-...-9159377 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataParams

type DataParams struct {
	TargetPath string
}

type HealthConfig

type HealthConfig struct {
	Test        []string      `json:",omitempty"`
	Interval    time.Duration `json:",omitempty"`
	Timeout     time.Duration `json:",omitempty"`
	StartPeriod time.Duration `json:",omitempty"`
	Retries     int           `json:",omitempty"`
}

type History

type History struct {
	Created    string `json:"created,omitempty"`
	Author     string `json:"author,omitempty"`
	CreatedBy  string `json:"created_by,omitempty"`
	Comment    string `json:"comment,omitempty"`
	EmptyLayer bool   `json:"empty_layer,omitempty"`
}

type ImageConfig

type ImageConfig struct {
	Created      time.Time `json:"created,omitempty"`
	Author       string    `json:"author,omitempty"`
	Architecture string    `json:"architecture"`
	OS           string    `json:"os"`
	OSVersion    string    `json:"os.version,omitempty"`
	OSFeatures   []string  `json:"os.features,omitempty"`
	Variant      string    `json:"variant,omitempty"`
	Config       RunConfig `json:"config"`
	RootFS       *RootFS   `json:"rootfs"`            //not used building images
	History      []History `json:"history,omitempty"` //not used building images
	//Extra fields
	Container     string `json:"container,omitempty"`
	DockerVersion string `json:"docker_version,omitempty"`
	//More extra fields
	ID      string `json:"id,omitempty"`
	Comment string `json:"comment,omitempty"`
}

ImageConfig describes the container image configurations (aka ConfigFile or V1Image/Image in other libraries) Fields (ordered according to spec): * https://github.com/opencontainers/image-spec/blob/main/config.md#properties * https://github.com/moby/moby/blob/e1c92184f08153456ecbf5e302a851afd6f28e1c/image/image.go#LL40C6-L40C13 Note: related to pkg/docker/dockerimage/V1ConfigObject|ConfigObject TODO: refactor into one set of common structs later

type ImageResult

type ImageResult struct {
	ID        string   `json:"id,omitempty"`
	Digest    string   `json:"digest,omitempty"`
	Name      string   `json:"name,omitempty"`
	OtherTags []string `json:"other_tags,omitempty"`
}

type LayerDataInfo

type LayerDataInfo struct {
	Type   LayerSourceType
	Source string
	Params *DataParams
}

type LayerSourceType

type LayerSourceType string
const (
	TarSource LayerSourceType = "lst.tar"
	DirSource LayerSourceType = "lst.dir"
)

type RootFS

type RootFS struct {
	Type    string   `json:"type"`
	DiffIDs []string `json:"diff_ids,omitempty"`
}

type RunConfig

type RunConfig struct {
	User         string              `json:"User,omitempty"`
	ExposedPorts map[string]struct{} `json:"ExposedPorts,omitempty"`
	Env          []string            `json:"Env,omitempty"`
	Entrypoint   []string            `json:"Entrypoint,omitempty"`
	Cmd          []string            `json:"Cmd,omitempty"`
	Volumes      map[string]struct{} `json:"Volumes,omitempty"`
	WorkingDir   string              `json:"WorkingDir,omitempty"`
	Labels       map[string]string   `json:"Labels,omitempty"`
	StopSignal   string              `json:"StopSignal,omitempty"`
	ArgsEscaped  bool                `json:"ArgsEscaped,omitempty"`
	Healthcheck  *HealthConfig       `json:"Healthcheck,omitempty"`
	//Extra fields
	AttachStderr    bool     `json:"AttachStderr,omitempty"`
	AttachStdin     bool     `json:"AttachStdin,omitempty"`
	AttachStdout    bool     `json:"AttachStdout,omitempty"`
	Domainname      string   `json:"Domainname,omitempty"`
	Hostname        string   `json:"Hostname,omitempty"`
	Image           string   `json:"Image,omitempty"`
	OnBuild         []string `json:"OnBuild,omitempty"`
	OpenStdin       bool     `json:"OpenStdin,omitempty"`
	StdinOnce       bool     `json:"StdinOnce,omitempty"`
	Tty             bool     `json:"Tty,omitempty"`
	NetworkDisabled bool     `json:"NetworkDisabled,omitempty"`
	MacAddress      string   `json:"MacAddress,omitempty"`
	StopTimeout     *int     `json:"StopTimeout,omitempty"`
	Shell           []string `json:"Shell,omitempty"`
}

RunConfig describes the runtime config parameters for container instances (aka Config in other libraries) Fields (ordered according to spec): Memory, MemorySwap, CpuShares aren't necessary * https://github.com/opencontainers/image-spec/blob/main/config.md#properties (Config field) * https://github.com/moby/moby/blob/master/api/types/container/config.go#L70 Note: related to pkg/docker/dockerimage/ContainerConfig TODO: refactor into one set of common structs later

type SimpleBuildEngine

type SimpleBuildEngine interface {
	Name() string
	Build(options SimpleBuildOptions) (*ImageResult, error)
}

type SimpleBuildOptions

type SimpleBuildOptions struct {
	From        string
	Tags        []string
	Layers      []LayerDataInfo
	ImageConfig ImageConfig
}

func SimpleBuildOptionsFromDockerfile

func SimpleBuildOptionsFromDockerfile(path string, ignoreExeInstructions bool) (*SimpleBuildOptions, error)

func SimpleBuildOptionsFromDockerfileData

func SimpleBuildOptionsFromDockerfileData(data string, ignoreExeInstructions bool) (*SimpleBuildOptions, error)

func SimpleBuildOptionsFromImageConfig

func SimpleBuildOptionsFromImageConfig(data *ImageConfig) (*SimpleBuildOptions, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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