Documentation
¶
Overview ¶
package docker implements a docker launchable type
Index ¶
- func GetContainerRegistryAuthStr(jsonKeyFile string) (string, error)
- func PruneResources(client *dockerclient.Client) error
- type Launchable
- func (l *Launchable) Disable(gracePeriod time.Duration) error
- func (l *Launchable) EnvDir() string
- func (l *Launchable) EnvVars() map[string]string
- func (l *Launchable) Executables(_ *runit.ServiceBuilder) ([]launch.Executable, error)
- func (l *Launchable) GetRestartTimeout() time.Duration
- func (l *Launchable) ID() launch.LaunchableID
- func (l *Launchable) InstallDir() string
- func (l *Launchable) Installed() bool
- func (l *Launchable) Launch(_ *runit.ServiceBuilder, _ runit.SV) error
- func (l *Launchable) MakeCurrent() error
- func (l *Launchable) PostActivate() (string, error)
- func (l *Launchable) PostInstall() (string, error)
- func (l *Launchable) Prune(size.ByteCount) error
- func (l *Launchable) RestartPolicy() runit.RestartPolicy
- func (l *Launchable) ServiceID() string
- func (l *Launchable) Stop(_ *runit.ServiceBuilder, _ runit.SV, _ bool) error
- func (*Launchable) Type() string
- type Mount
- type Mounts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PruneResources ¶
func PruneResources(client *dockerclient.Client) error
Types ¶
type Launchable ¶
type Launchable struct {
// LaunchableID is the ID of the launchable within the pod manifest, not to be
// confused with the container ID or the container name we'll use to
// identify the container with docker.
LaunchableID launch.LaunchableID
// The name of the docker image to run, as if passed to the docker
// command line
Image string
// RunAs is the name of the user the container should run as inside the container
RunAs string
// The home directory of the pod
PodHomeDir string
// Env variables that are written to disk by P2 related to the Pod
PodEnvDir string
// RootDir is where P2 writes files related to this container, not to be
// confused with the container filesystem's location on disk which is managed
// by dockerd
RootDir string
// RestartTimeout is poorly named in the context of docker containers, since
// we never restart a container, only stop them and start them. In this case
// it's the amount of time we ask docker to give a container to stop after
// SIGTERM is sent before SIGKILL
RestartTimeout time.Duration
// Unique name for log messages to uniquely identify the pod and container
ServiceID_ string
// DockerClient is the client used to start and stop containers
DockerClient *dockerclient.Client
// EntryPoint is the entrypoint to run with the docker container if passed to the manifest
Entrypoint strslice.StrSlice
// PostStartCmd is the cmd in the container to run after the container has started
PostStartCmd []string
// PreStopCmd is the cmd in the container to run before the container is stopped
PreStopCmd []string
// ParentCgroupID is the name of the pod-wide cgroup. Docker containers will
// be configured with cgroups inheriting from this one.
ParentCgroupID string
// CPUQuota is the number of CPUs the cgroup is allowed to use. Technically, this
// measurement is in "millions of microseconds per second", so it should be multiplied
// by a million before being passed to docker
CPUQuota int
// CgroupMemorySize is the max allowed memory docker should set for the cgroup for
// the container
CgroupMemorySize size.ByteCount
// RestartPolicy_ determines what behavior docker should have when the pod exits.
// Typically it will indicate that docker should always restart the container
// for long-running services (e.g. servers)
RestartPolicy_ runit.RestartPolicy
// SuppliedEnvVars is a map of environment variables passed in the
// launchable stanza
SuppliedEnvVars map[string]string
}
func (*Launchable) EnvDir ¶
func (l *Launchable) EnvDir() string
func (*Launchable) EnvVars ¶
func (l *Launchable) EnvVars() map[string]string
func (*Launchable) Executables ¶
func (l *Launchable) Executables(_ *runit.ServiceBuilder) ([]launch.Executable, error)
func (*Launchable) GetRestartTimeout ¶
func (l *Launchable) GetRestartTimeout() time.Duration
func (*Launchable) ID ¶
func (l *Launchable) ID() launch.LaunchableID
func (*Launchable) InstallDir ¶
func (l *Launchable) InstallDir() string
func (*Launchable) Installed ¶
func (l *Launchable) Installed() bool
func (*Launchable) Launch ¶
func (l *Launchable) Launch(_ *runit.ServiceBuilder, _ runit.SV) error
func (*Launchable) MakeCurrent ¶
func (l *Launchable) MakeCurrent() error
func (*Launchable) PostActivate ¶
func (l *Launchable) PostActivate() (string, error)
func (*Launchable) PostInstall ¶
func (l *Launchable) PostInstall() (string, error)
func (*Launchable) RestartPolicy ¶
func (l *Launchable) RestartPolicy() runit.RestartPolicy
func (*Launchable) ServiceID ¶
func (l *Launchable) ServiceID() string
func (*Launchable) Stop ¶
func (l *Launchable) Stop(_ *runit.ServiceBuilder, _ runit.SV, _ bool) error
func (*Launchable) Type ¶
func (*Launchable) Type() string
Click to show internal directories.
Click to hide internal directories.