Versions in this module Expand all Collapse all v0 v0.1.0 Jun 17, 2026 Changes in this version + func CleanupContainer(t testing.TB, c Container, opts ...TerminateOption) + func CleanupNetwork(t testing.TB, nw Network) + func GenericLabels() map[string]string + func Prune(ctx context.Context) error + func Reset() + func Run(ctx context.Context, img string, opts ...ContainerCustomizer) (*cliContainer, error) + func SessionID() string + func SkipIfProviderNotHealthy(t testing.TB) + func VersionCheck(ctx context.Context) (string, error) + type CLIArgsModifier func([]string) []string + type Config struct + BinaryPath string + Debug bool + DefaultNetwork string + DefaultPlatform string + HubImagePrefix string + PullTimeout time.Duration + func Read() Config + type Configuration struct + CapAdd []string + CapDrop []string + CreationDate string + DNS DNS + ID string + Image Image + InitProcess InitProcess + Labels map[string]string + Mounts []InspectMount + Networks []NetworkConfig + Platform Platform + PublishedPorts []PublishedPort + PublishedSockets []json.RawMessage + ReadOnly bool + Resources Resources + Rosetta bool + RuntimeHandler string + SSH bool + StopSignal string + Sysctls map[string]string + UseInit bool + Virtualization bool + type Container interface + ContainerIP func(context.Context) (string, error) + CopyFileFromContainer func(ctx context.Context, path string) (io.ReadCloser, error) + CopyFileToContainer func(ctx context.Context, hostPath, containerPath string, mode int64) error + CopyToContainer func(ctx context.Context, content []byte, containerPath string, mode int64) error + Endpoint func(ctx context.Context, port string) (string, error) + Exec func(ctx context.Context, cmd []string, opts ...ProcessOption) (int, []byte, error) + GetContainerID func() string + Host func(context.Context) (string, error) + Inspect func(context.Context) (*Inspect, error) + IsRunning func() bool + Logs func(context.Context) (io.ReadCloser, error) + MappedPort func(ctx context.Context, port string) (int, error) + Networks func(context.Context) ([]string, error) + PortEndpoint func(ctx context.Context, port string, proto string) (string, error) + SessionID func() string + Start func(context.Context) error + State func(context.Context) (*State, error) + Stop func(context.Context, *time.Duration) error + Terminate func(ctx context.Context, opts ...TerminateOption) error + type ContainerCustomizer interface + Customize func(req *ContainerRequest) error + func WithAdditionalLifecycleHooks(hooks ContainerLifecycleHooks) ContainerCustomizer + func WithAdditionalWaitStrategy(s wait.Strategy) ContainerCustomizer + func WithAlwaysPull(alwaysPull bool) ContainerCustomizer + func WithArch(arch string) ContainerCustomizer + func WithCLIArgsModifier(modifier CLIArgsModifier) ContainerCustomizer + func WithCPUs(cpus float64) ContainerCustomizer + func WithCapAdd(capAdd ...string) ContainerCustomizer + func WithCapDrop(capDrop ...string) ContainerCustomizer + func WithCmd(cmd ...string) ContainerCustomizer + func WithCmdArgs(args ...string) ContainerCustomizer + func WithContainerfile(cf FromContainerfile) ContainerCustomizer + func WithDNS(dns ...string) ContainerCustomizer + func WithDNSDomain(domain string) ContainerCustomizer + func WithDNSSearch(search ...string) ContainerCustomizer + func WithEntrypoint(entrypoint ...string) ContainerCustomizer + func WithEntrypointArgs(args ...string) ContainerCustomizer + func WithEnv(env map[string]string) ContainerCustomizer + func WithEnvFile(filePath string) ContainerCustomizer + func WithExposedPorts(ports ...string) ContainerCustomizer + func WithFiles(files ...ContainerFile) ContainerCustomizer + func WithHostPortMapping(mapping bool) ContainerCustomizer + func WithImage(image string) ContainerCustomizer + func WithInit(init bool) ContainerCustomizer + func WithLabels(labels map[string]string) ContainerCustomizer + func WithLifecycleHooks(hooks ContainerLifecycleHooks) ContainerCustomizer + func WithLogConsumers(consumers ...LogConsumer) ContainerCustomizer + func WithLogger(logger any) ContainerCustomizer + func WithMemory(memory int64) ContainerCustomizer + func WithMounts(mounts ...Mount) ContainerCustomizer + func WithName(name string) ContainerCustomizer + func WithNetwork(aliases []string, nw Network) ContainerCustomizer + func WithNetworkName(network string) ContainerCustomizer + func WithNetworks(networks ...string) ContainerCustomizer + func WithNewNetwork(ctx context.Context, aliases []string, opts ...NetworkOption) ContainerCustomizer + func WithNoDNS(noDNS bool) ContainerCustomizer + func WithOS(os string) ContainerCustomizer + func WithPlatform(platform string) ContainerCustomizer + func WithReadOnlyRootfs(readOnly bool) ContainerCustomizer + func WithRosetta(rosetta bool) ContainerCustomizer + func WithShmSize(shmSize int64) ContainerCustomizer + func WithTmpfs(tmpfs map[string]string) ContainerCustomizer + func WithUlimits(ulimits ...Ulimit) ContainerCustomizer + func WithUser(user string) ContainerCustomizer + func WithVolumes(volumes ...VolumeMount) ContainerCustomizer + func WithWaitStrategy(s wait.Strategy) ContainerCustomizer + func WithWaitStrategyAndDeadline(s wait.Strategy, deadline time.Duration) ContainerCustomizer + func WithWaitingFor(s wait.Strategy) ContainerCustomizer + func WithWorkingDir(workingDir string) ContainerCustomizer + type ContainerFile struct + ContainerFilePath string + FileMode int64 + HostFilePath string + type ContainerHook func(ctx context.Context, c Container) error + type ContainerLifecycleHooks struct + PostBuilds []ContainerRequestHook + PostCreates []ContainerRequestHook + PostReadies []ContainerHook + PostStarts []ContainerHook + PostStops []ContainerHook + PostTerminates []ContainerHook + PreBuilds []ContainerRequestHook + PreCreates []ContainerRequestHook + PreStarts []ContainerHook + PreStops []ContainerHook + PreTerminates []ContainerHook + type ContainerProvider interface + Close func() error + ContainerLogs func(ctx context.Context, id string, follow bool, n int) (io.ReadCloser, error) + CopyFileFromContainer func(ctx context.Context, id, path string) (io.ReadCloser, error) + CopyToContainer func(ctx context.Context, id, containerPath string, content []byte, mode int64) error + CreateContainer func(ctx context.Context, req *ContainerRequest) (*cliContainer, error) + DeleteContainer func(ctx context.Context, id string, force bool) error + ExecContainer func(ctx context.Context, id string, cmd []string, opts ...ProcessOption) (int, []byte, error) + Health func(ctx context.Context) error + ImageInspect func(ctx context.Context, ref string) (*ImageInspect, error) + ImagePull func(ctx context.Context, ref string, opts ...PullOption) error + InspectContainer func(ctx context.Context, id string) (*Inspect, error) + KillContainer func(ctx context.Context, id string, signal string) error + StartContainer func(ctx context.Context, c *cliContainer) error + StopContainer func(ctx context.Context, id string, timeout *time.Duration) error + type ContainerRequest struct + AlwaysPull bool + Arch string + CLIArgsModifier CLIArgsModifier + CPUs float64 + CapAdd []string + CapDrop []string + Cmd []string + DNS []string + DNSDomain string + DNSSearch []string + Entrypoint []string + Env map[string]string + ExposedPorts []string + Files []ContainerFile + FromContainerfile FromContainerfile + HostPortMapping bool + HostPorts map[string]int + Image string + Init bool + Labels map[string]string + LifecycleHooks ContainerLifecycleHooks + LogConsumerCfg *LogConsumerCfg + Memory int64 + Mounts []Mount + Name string + NetworkAliases map[string][]string + Networks []string + NoDNS bool + OS string + Platform string + ReadOnlyRootfs bool + Rosetta bool + ShmSize int64 + Tmpfs map[string]string + Ulimits []Ulimit + User string + Volumes []VolumeMount + WaitingFor WaitingFor + WorkingDir string + func (req *ContainerRequest) Validate() error + type ContainerRequestHook func(ctx context.Context, req *ContainerRequest) error + type CustomizeRequestOption func(req *ContainerRequest) error + func (f CustomizeRequestOption) Customize(req *ContainerRequest) error + type DNS struct + Nameservers []string + Options []string + SearchDomains []string + type Descriptor struct + Digest string + MediaType string + Size int64 + type FromContainerfile struct + BuildArgs map[string]*string + Context string + File string + KeepImage bool + NoCache bool + Platform string + Pull bool + Secrets map[string]string + Tags []string + Target string + type Image struct + Descriptor Descriptor + Reference string + type ImageInspect struct + ID string + type InitProcess struct + Arguments []string + Environment []string + Executable string + Rlimits []json.RawMessage + SupplementalGroups []int + Terminal bool + User User + WorkingDirectory string + type Inspect struct + Configuration Configuration + ID string + type InspectMount struct + Destination string + Options []string + Source string + Type InspectMountType + type InspectMountType struct + VirtioFS json.RawMessage + type ListEntry = Inspect + type Log struct + Content []byte + LogType string + type LogConsumer interface + Accept func(Log) + type LogConsumerCfg struct + Consumers []LogConsumer + type Mount struct + ReadOnly bool + Source string + Target string + Type MountType + type MountType string + const MountTypeBind + const MountTypeTmpfs + const MountTypeVolume + type Network interface + Name func() string + Remove func(ctx context.Context) error + func NewNetwork(ctx context.Context, opts ...NetworkOption) (Network, error) + type NetworkConfig struct + Network string + Options map[string]any + type NetworkInfo struct + Hostname string + IPv4Address string + IPv4Gateway string + IPv6Address string + MTU int + MacAddress string + Network string + func (n NetworkInfo) IPv4() string + type NetworkOption func(*NetworkRequest) + func WithEnableIPv6(enable bool) NetworkOption + func WithInternal(internal bool) NetworkOption + func WithNetworkDriver(driver string) NetworkOption + func WithNetworkLabels(labels map[string]string) NetworkOption + func WithNetworkNameOption(name string) NetworkOption + func WithSubnet(subnet string) NetworkOption + func WithSubnetV6(subnet string) NetworkOption + type NetworkRequest struct + Driver string + EnableIPv6 bool + Internal bool + Labels map[string]string + Name string + Subnet string + SubnetV6 string + type Platform struct + Architecture string + OS string + type ProcessOption func(*processOptions) + func WithExecEnv(env []string) ProcessOption + func WithExecUser(user string) ProcessOption + func WithExecWorkingDir(dir string) ProcessOption + type PublishedPort struct + ContainerPort int + Count int + HostAddress string + HostPort int + Proto string + type PullOption func(*pullOptions) + type Resources struct + CPUOverhead int + CPUs int + MemoryInBytes int64 + type State struct + ExitCode int + Networks []NetworkInfo + StartedDate string + Status string + type StatsEntry struct + BlockReadBytes int64 + BlockWriteBytes int64 + CPUUsageUsec int64 + ID string + MemoryLimitBytes int64 + MemoryUsageBytes int64 + NetworkRxBytes int64 + NetworkTxBytes int64 + NumProcesses int + type StdoutLogConsumer struct + func (s *StdoutLogConsumer) Accept(l Log) + type TerminateOption func(*terminateOptions) + type Ulimit struct + Hard int64 + Name string + Soft int64 + type User struct + ID UserID + type UserID struct + GID int + UID int + type Volume interface + Name func() string + Remove func(ctx context.Context) error + func NewVolume(ctx context.Context, opts ...VolumeOption) (Volume, error) + type VolumeMount struct + ReadOnly bool + Source string + Target string + type VolumeOption func(*VolumeRequest) + func WithVolumeLabels(labels map[string]string) VolumeOption + func WithVolumeNameOption(name string) VolumeOption + func WithVolumeOpt(key, val string) VolumeOption + func WithVolumeSize(size string) VolumeOption + type VolumeRequest struct + Labels map[string]string + Name string + Options map[string]string + Size string + type WaitingFor = wait.Strategy