docker

package
v0.0.0-...-ff55af6 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainerCmder

func ContainerCmder(containerNameOrID string) exec.Cmder

ContainerCmder creates a new exec.Cmder against a docker container

func CopyFrom

func CopyFrom(containerNameOrID, srcPath, hostPath string) error

CopyFrom copies the file or dir in the container at srcPath to the host at hostPath

func CopyTo

func CopyTo(hostPath, containerNameOrID, destPath string) error

CopyTo copies the file at hostPath to the container at destPath

func PullIfNotPresent

func PullIfNotPresent(image string, retries int) (bool, error)

PullIfNotPresent will pull an image if it is not present locally retrying up to retries times it returns true if it attempted to pull, and any errors from pulling

func Run

func Run(image string, opts ...RunOpt) error

Run creates a container with "docker run", with some error handling

Types

type RunOpt

type RunOpt func(*runOpts) *runOpts

RunOpt is an option for Run

func WithContainerArgs

func WithContainerArgs(args ...string) RunOpt

WithContainerArgs sets the args to the container as in the containerArgs portion of `docker run args... image containerArgs...` NOTE: this is only the args portion before the image

func WithRunArgs

func WithRunArgs(args ...string) RunOpt

WithRunArgs sets the args for docker run as in the args portion of `docker run args... image containerArgs...`

Jump to

Keyboard shortcuts

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