Documentation ¶
Overview ¶
Package docker implements the docker task types.
Index ¶
- Variables
- func Docker(name string, cmdv []string, st *state.State) error
- func DockerOutput(name string, cmdv []string, st *state.State) (string, string, error)
- func ImageID(tag string, logger *gomol.LogAdapter, st *state.State) (string, error)
- func ParseCommand(argv []string) (tasks.Task, error)
- func ParseImage(image string) (string, string, string)
- func StopContainer(cid string, logger *gomol.LogAdapter, st *state.State) error
- type Build
- type Environment
- type Export
- type HealthCheck
- type Import
- type Login
- type Logout
- type Network
- type Pull
- type Push
- type Remove
- type Run
- type Tag
- type Workspace
Constants ¶
This section is empty.
Variables ¶
var ( // Tasks is a map of all docker tasks. Tasks = map[string]tasks.Task{ "build": &Build{}, "export": &Export{}, "import": &Import{}, "login": &Login{}, "logout": &Logout{}, "pull": &Pull{}, "push": &Push{}, "remove": &Remove{}, "run": &Run{}, "tag": &Tag{}, "environment": &Environment{}, } )
Functions ¶
func DockerOutput ¶ added in v0.8.0
DockerOutput runs a docker command but returns the output rather than outputting to the logger.
func ParseCommand ¶
ParseCommand is a super stripped down kingpin parser that will parse docker command line options and return a convey task or an error
func ParseImage ¶ added in v0.8.0
ParseImage will convert an image like python:3 to it's registry, name, and tag
func StopContainer ¶ added in v0.9.0
StopContainer will call 'docker stop' on the given container id
Types ¶
type Build ¶
type Build struct { Dockerfile string `yaml:"dockerfile"` Files yaml.StringOrSlice `yaml:"files"` Tag string `yaml:"tag"` Tags yaml.StringOrSlice `yaml:"tags"` Target string `yaml:"target"` Labels yaml.StringOrSlice `yaml:"labels"` Arguments yaml.StringOrSlice `yaml:"arguments"` }
Build defines the options for building a docker image.
type Environment ¶ added in v0.11.0
type Environment struct { File string `yaml:"from-file"` Files yaml.StringOrSlice `yaml:"from-files"` Prefix string `yaml:"prefix"` }
Environment contains options for loading environment variables from a file in the workspace.
func (*Environment) Execute ¶ added in v0.11.0
func (e *Environment) Execute(name string, logger *gomol.LogAdapter, env []string, st *state.State) error
Execute runs the environment plan.
func (*Environment) New ¶ added in v0.11.0
func (e *Environment) New() tasks.Task
New creates a new environment command.
func (*Environment) Valid ¶ added in v0.11.0
func (e *Environment) Valid() error
Valid validate the environment command.
type Export ¶
type Export struct { Files yaml.StringOrSlice `yaml:"files"` Path string }
Export represents an export task which exports files from the workspace to the host.
type HealthCheck ¶ added in v0.9.0
type HealthCheck struct { Command string `yaml:"command"` Interval time.Duration `yaml:"interval"` Retries int `yaml:"retries"` StartPeriod time.Duration `yaml:"start-period"` Timeout time.Duration `yaml:"timeout"` }
HealthCheck represents a docker health check.
type Import ¶
type Import struct {
Files yaml.StringOrSlice `yaml:"files"`
}
Import represents an import task which imports files from the host to the workspace.
type Login ¶
type Login struct { Username string `yaml:"username"` Password string `yaml:"password"` Server string `yaml:"server"` }
Login represents an login task for logging into a docker registry.
type Logout ¶
type Logout struct {
Server string `yaml:"server"`
}
Logout represents a logout task which logs out of a docker registry.
type Network ¶ added in v0.9.0
type Network struct {
// contains filtered or unexported fields
}
Network represents a docker network.
func NewNetwork ¶ added in v0.9.0
NewNetwork creates a new docker network.
type Pull ¶
type Pull struct { Image string `yaml:"image"` Images yaml.StringOrSlice `yaml:"images"` }
Pull represents a docker pull task which pulls an image from a docker registry.
type Push ¶
type Push struct { Image string `yaml:"image"` Images yaml.StringOrSlice `yaml:"images"` }
Push represents a docker push task which push an image to a docker registry.
type Remove ¶
type Remove struct { Image string `yaml:"image"` Images yaml.StringOrSlice `yaml:"images"` Quiet bool `yaml:"quiet"` }
Remove represents a docker rm task which deletes a local docker image.
type Run ¶
type Run struct { Command string `yaml:"command"` Detach bool `yaml:"detach"` Hostname string `yaml:"hostname"` EntryPoint string `yaml:"entrypoint"` Environment yaml.StringOrSlice `yaml:"environment"` Image string `yaml:"image"` WorkDir string `yaml:"workdir"` WorkSpace string `yaml:"workspace"` Script yaml.StringOrSlice `yaml:"script"` Shell string `yaml:"shell"` Labels yaml.StringOrSlice `yaml:"labels"` User string `yaml:"user"` HealthCheck HealthCheck `yaml:"healthcheck"` }
Run represents a docker run task which will run a container.
func (*Run) UnmarshalYAML ¶ added in v0.5.0
UnmarshalYAML is a custom yaml unmarshaller for run tasks.
type Tag ¶
type Tag struct { Source string `yaml:"source"` Destination string `yaml:"destination"` Destinations yaml.StringOrSlice `yaml:"destinations"` }
Tag represents a docker tag command.
type Workspace ¶ added in v0.9.0
type Workspace struct {
// contains filtered or unexported fields
}
Workspace represents a docker workspace.
func NewWorkspace ¶ added in v0.9.0
NewWorkspace creates a new docker workspace.