Documentation
¶
Index ¶
- Variables
- func ContainerExists(ops *def.Operation) (docker.APIContainers, bool)
- func ContainerRunning(ops *def.Operation) (docker.APIContainers, bool)
- func DataContainerExists(ops *def.Operation) (docker.APIContainers, bool)
- func DockerCreateData(ops *def.Operation) error
- func DockerExecData(ops *def.Operation, service *def.Service) (err error)
- func DockerExecService(srv *def.Service, ops *def.Operation) error
- func DockerInspect(srv *def.Service, ops *def.Operation, field string) error
- func DockerLogs(srv *def.Service, ops *def.Operation, follow bool, tail string) error
- func DockerPull(srv *def.Service, ops *def.Operation) error
- func DockerRebuild(srv *def.Service, ops *def.Operation, skipPull bool, timeout uint) error
- func DockerRemove(srv *def.Service, ops *def.Operation, withData, volumes bool) error
- func DockerRename(ops *def.Operation, newName string) error
- func DockerRunData(ops *def.Operation, service *def.Service) (result []byte, err error)
- func DockerRunService(srv *def.Service, ops *def.Operation) error
- func DockerStop(srv *def.Service, ops *def.Operation, timeout uint) error
Constants ¶
This section is empty.
Variables ¶
var (
ErrContainerExists = errors.New("container exists")
)
Functions ¶
func ContainerExists ¶
ContainerExists returns APIContainers containers list and true if the container ops.SrvContainerName exists, otherwise false.
func ContainerRunning ¶
ContainerExists returns APIContainers containers list and true if the container ops.SrvContainerName exists and is running, otherwise false.
func DataContainerExists ¶
ContainerExists returns APIContainers containers list and true if the container ops.DataContainerName exists and running, otherwise false.
func DockerCreateData ¶
DockerCreateData creates a blank data container. It returns ErrContainerExists if such a container exists or other Docker errors.
ops.DataContainerName - data container name to be created ops.ContainerType - container type ops.ContainerNumber - container number ops.Labels - container creation time labels (use LoadDataDefinition)
func DockerExecData ¶
DockerExecData runs a data container with volumes-from field set interactively.
ops.Args - command line parameters ops.Interactive - if true, set Entrypoint to ops.Args, if false, set Cmd to ops.Args
See parameter description for DockerRunData.
func DockerExecService ¶
DockerExecService creates and runs a chain or a service container interactively.
ops.Args - command line parameters ops.Interactive - if true, set Entrypoint to ops.Args, if false, set Cmd to ops.Args
See parameter description for DockerRunService.
func DockerInspect ¶
DockerInspect displays container ops.SrvContainerName data on the terminal. field can be a field name of one of `docker inspect` output or it can be either "line" to display a short info line or "all" to display everything. I DockerInspect returns Docker errors on exit in not successful.
func DockerLogs ¶
DockerLogs displays tail number of lines of container ops.SrvContainerName output. If follow is true, it behaves like `tail -f`. It returns Docker errors on exit if not successful.
func DockerPull ¶
DockerPull pulls the image for the container specified in srv.Image. DockerPull returns Docker errors on exit if not successful.
ops.SrvContainerName - service or a chain container name ops.ContainerNumber - container number ops.ContainerType - container type ops.Labels - container creation time labels
Also see container parameters for DockerRunService.
func DockerRebuild ¶
DockerRebuild recreates the container based on the srv settings template. Unless skipPull is true, it updates the Docker image before recreating the container. timeout is a number of seconds to wait before killing the container process ungracefully.
ops.SrvContainerName - service or a chain container name to rebuild ops.ContainerNumber - container number ops.ContainerType - container type ops.Labels - container creation time labels
Also see container parameters for DockerRunService.
func DockerRemove ¶
DockerRemove removes the ops.SrvContainerName container unforcedly. If withData is true, the associated data container is also removed. If volumes is true, the associated volumes are removed for both containers. DockerRemove returns Docker errors on exit if not successful.
func DockerRename ¶
DockerRename renames the container by removing and recreating it. The container is also restarted if it was running before rename. The container ops.SrvContainerName is renamed to a new name, constructed using a short given newName. DockerRename returns Docker errors on exit or ErrContainerExists if the container with the new (long) name exists.
ops.SrvContainerName - container name ops.ContainerNumber - container number ops.ContainerType - container type ops.Labels - container creation time labels
func DockerRunData ¶
DockerRunData runs a data container with the volumes-from option set. The container is destroyed on exit; the container log is returned as a byte stream. If service parameter is specified, the command inherits the service settings from that container.
ops.DataContainerName - container name to be mount with `--volumes-from=[]` option. ops.ContainerType - container type ops.ContainerNumber - container number ops.Labels - container creation time labels (use LoadDataDefinition) ops.Args - if specified, run these args in a container
func DockerRunService ¶
DockerRunService creates and runs a chain or a service container with the srv settings template. It also creates dependent data containers if srv.AutoData is true. DockerRunService returns Docker errors if not successful.
srv.AutoData - if true, create or use existing data container ops.SrvContainerName - service or a chain container name ops.DataContainerName - dependent data container name ops.ContainerNumber - container number ops.ContainerType - container type ops.Labels - container creation time labels (use LoadServiceDefinition or LoadChainDefinition)
Container parameters:
ops.Remove - remove container on exit (similar to `docker run --rm`) ops.PublishAllPorts - if true, publish exposed ports to random ports ops.CapAdd - add linux capabilities (similar to `docker run --cap-add=[]`) ops.CapDrop - add linux capabilities (similar to `docker run --cap-drop=[]`) ops.Privileged - if true, give extended privileges ops.Restart - container restart policy ("always", "max:<#attempts>" or never if unspecified)
func DockerStop ¶
DockerStop stops a running ops.SrvContainerName container unforcedly. timeout is a number of seconds to wait before killing the container process ungracefully. It returns Docker errors on exit if not successful. DockerStop doesn't return an error if the container isn't running.
Types ¶
This section is empty.