package
0.0.0-20250130204033-e82d90384e5b
Repository: https://github.com/laurentgoderre/moby.git
Documentation: pkg.go.dev
# Functions
Create creates a container with the specified options, asserting that there was no error.
CreateFromConfig creates a container from the given TestContainerConfig.
Exec executes a command inside a container, returning the result containing stdout, stderr, and exit code.
ExecT calls Exec() and aborts the test if an error occurs.
GetContainerNS gets the value of the specified namespace of a container.
No description provided by the author
IsInState verifies the container is in one of the specified state, e.g., "running", "exited", etc.
IsRemoved verifies the container has been removed.
IsStopped verifies the container is in stopped state.
IsSuccessful verifies state.Status == "exited" && state.ExitCode == 0.
NewTestConfig creates a new TestContainerConfig with the provided options.
Output waits for the container to end running and returns its output.
No description provided by the author
Run creates and start a container with the specified options.
No description provided by the author
RunningStateFlagIs polls for the container's Running state flag to be equal to running.
WithAdditionalGroups sets the additional groups for the container.
WithAnnotations set the annotations for the container.
WithAutoRemove sets the container to be removed on exit.
WithBind sets the bind mount of the container.
WithBindRaw sets the bind mount of the container.
No description provided by the author
WithCDIDevices sets the CDI devices to use to start the container.
WithCgroupnsMode sets the cgroup namespace mode for the container.
WithCmd sets the commands of the container.
WithConsoleSize sets the initial console size of the container.
No description provided by the author
WithDNS sets external DNS servers for the container.
No description provided by the author
No description provided by the author
WithExposedPorts sets the exposed ports of the container.
WithExtraHost sets the user defined IP:Host mappings in the container's /etc/hosts file.
WithHostname sets the hostname 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.
WithIsolation specifies the isolation technology to apply to the container.
WithLinks sets the links of the container.
WithLogDriver sets the log driver to use for the container.
No description provided by the author
WithMount adds an mount.
WithName sets the name of the container.
WithNetworkMode sets the network mode of the container.
WithPIDMode sets the PID-mode for the container.
WithPidsLimit sets the container's "pids-limit.
WithPlatform specifies the desired platform the image should have.
WithPortMap sets/replaces port mappings.
WithPrivileged sets privileged mode for the container.
WithRestartPolicy sets container's restart policy.
WithRuntime sets the runtime to use to start the container.
No description provided by the author
No description provided by the author
WithSysctls sets sysctl options for the container.
WithTmpfs sets a target path in the container to a tmpfs, with optional options (separated with a colon).
WithTty sets the TTY mode of the container.
WithUser sets the user.
WithVolume sets the volume of the container.
WithWindowsDevice specifies a Windows Device, ala `--device` on the CLI.
WithWorkingDir sets the working dir of the container.
# Structs
No description provided by the author
ExecResult represents a result returned from Exec().
No description provided by the author
TestContainerConfig holds container configuration struct that are used in api calls.