Documentation
¶
Index ¶
- Variables
- type DataParams
- type DockerfileBuildEngine
- type DockerfileBuildOptions
- type HealthConfig
- type History
- type ImageConfig
- type ImageResult
- type LayerDataInfo
- type LayerSourceType
- type NVParam
- type RootFS
- type RunConfig
- type SimpleBuildEngine
- type SimpleBuildOptions
- func SimpleBuildOptionsFromDockerfile(path string, ignoreExeInstructions bool) (*SimpleBuildOptions, error)
- func SimpleBuildOptionsFromDockerfileData(data string, ignoreExeInstructions bool) (*SimpleBuildOptions, error)
- func SimpleBuildOptionsFromImageConfig(data *ImageConfig) (*SimpleBuildOptions, error)
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidContextDir = errors.New("invalid context directory")
)
Functions ¶
This section is empty.
Types ¶
type DataParams ¶
type DataParams struct {
TargetPath string
}
type DockerfileBuildEngine ¶
type DockerfileBuildEngine interface {
Name() string
Build(options DockerfileBuildOptions) error
}
type DockerfileBuildOptions ¶
type DockerfileBuildOptions struct {
Dockerfile string
BuildContext string
IgnoreFile string
ImagePath string
BuildArgs []NVParam
Labels map[string]string
Target string
NetworkMode string
ExtraHosts string //already a comma separated list
CacheFrom []string
CacheTo []string
Platforms []string
OutputStream io.Writer
}
type HealthConfig ¶
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"`
AddHistory []History `json:"add_history,omitempty"` //extra field
//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 LayerDataInfo ¶
type LayerDataInfo struct {
Type LayerSourceType
Source string
Params *DataParams
EntrypointLayer bool
ResetCmd bool
}
type LayerSourceType ¶
type LayerSourceType string
const ( TarSource LayerSourceType = "lst.tar" DirSource LayerSourceType = "lst.dir" FileSource LayerSourceType = "lst.file" FileListSource LayerSourceType = "lst.file_list" )
type RunConfig ¶
type RunConfig struct {
User string `json:"User,omitempty"`
ExposedPorts map[string]struct{} `json:"ExposedPorts,omitempty"`
AddExposedPorts map[string]struct{} `json:"AddExposedPorts,omitempty"` //extra field
RemoveExposedPorts []string `json:"RemoveExposedPorts,omitempty"` //extra field
Env []string `json:"Env,omitempty"`
AddEnv []string `json:"AddEnv,omitempty"` //extra field
Entrypoint []string `json:"Entrypoint,omitempty"`
IsShellEntrypoint bool `json:"IsShellEntrypoint,omitempty"` //extra field
Cmd []string `json:"Cmd,omitempty"`
IsShellCmd bool `json:"IsShellCmd,omitempty"` //extra field
Volumes map[string]struct{} `json:"Volumes,omitempty"`
AddVolumes map[string]struct{} `json:"AddVolumes,omitempty"` //extra field
WorkingDir string `json:"WorkingDir,omitempty"`
Labels map[string]string `json:"Labels,omitempty"`
AddLabels map[string]string `json:"AddLabels,omitempty"` //extra field
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
FromTar string
Tags []string
Layers []LayerDataInfo
ImageConfig *ImageConfig
HideBuildHistory bool
OutputImageTar string
}
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)