package
20.10.14+incompatible
Repository: https://github.com/devopsjen/devopstool-moby.git
Documentation: pkg.go.dev
# Functions
Create creates a container with the specified options, asserting that there was no error.
CreateExpectingErr creates a container, expecting an error with the specified message.
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.
WithCgroupnsMode sets the cgroup namespace mode for the container.
WithCmd sets the comannds of the container.
WithExposedPorts sets the exposed ports of the container.
WithExtraHost sets the user defined IP:Host mappings in the container's /etc/hosts file.
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.
WithPlatform specifies the desired platform the image should have.
WithPrivileged sets privileged mode for the container.
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.