package
0.0.0-20200321120002-dd2de08144c3
Repository: https://github.com/wuka1/docker.git
Documentation: pkg.go.dev
# Functions
Create creates a container with the specified options.
Exec executes a command inside a container, returning the result containing stdout, stderr, and exit code.
IsInState verifies the container is in one of the specified state, e.g., "running", "exited", etc.
IsStopped verifies the container is in stopped state.
IsSuccessful verifies state.Status == "exited" && state.ExitCode == 0.
Run creates and start a container with the specified options.
WithAutoRemove sets the container to be removed on exit.
WithBind sets the bind mount of the container.
WithCmd sets the comannds of the container.
WithExposedPorts sets the exposed ports of the container.
WithImage sets the image of the container.
WithIPv4 sets the specified ip for the specified network of the container.
WithIPv6 sets the specified ip6 for the specified network of the container.
WithLinks sets the links of the container.
WithLogDriver sets the log driver to use for the container.
WithMount adds an mount.
WithName sets the name of the container.
WithNetworkMode sets the network mode of the container.
WithPidsLimit sets the container's "pids-limit.
WithRestartPolicy sets container's restart policy.
WithTmpfs sets a target path in the container to a tmpfs.
WithTty sets the TTY mode of the container.
WithUser sets the user.
WithVolume sets the volume of the container.
WithWorkingDir sets the working dir of the container.
# Structs
ExecResult represents a result returned from Exec().
TestContainerConfig holds container configuration struct that are used in api calls.