Versions in this module Expand all Collapse all v0 v0.13.0 May 23, 2024 v0.12.0 Apr 11, 2024 v0.11.1 Mar 13, 2024 v0.11.0 Feb 8, 2024 Changes in this version type Runner + func (d *Runner) RestartContainerWithTimeout(ctx context.Context, containerID string, timeout int) error v0.10.2 Oct 9, 2023 v0.10.1 Oct 9, 2023 v0.10.0 Sep 5, 2023 v0.9.2 Jul 25, 2023 v0.9.1 May 26, 2023 Changes in this version + const DockerAPIVersion + func BuildImage(ctx context.Context, api *client.Client, containerfile string, ...) ([]byte, error) + func NewDockerAPI() (*client.Client, error) + func RunCmdInBackground(api *client.Client, ctx context.Context, container string, cmd []string, ...) (string, error) + func RunCmdWithOutput(api *client.Client, ctx context.Context, container string, cmd []string, ...) ([]byte, []byte, int, error) + type BuildArgs map[string]*string + func (u BuildArgs) Apply(cfg *types.ImageBuildOptions) error + type BuildContext map[string]PathContents + func BuildContextFromTarball(reader io.Reader) (BuildContext, error) + func NewBuildContext() BuildContext + func (bCtx *BuildContext) ToTarball() (io.Reader, error) + type BuildForceRemove bool + func (u BuildForceRemove) Apply(cfg *types.ImageBuildOptions) error + type BuildOpt interface + Apply func(cfg *types.ImageBuildOptions) error + type BuildPullParent bool + func (u BuildPullParent) Apply(cfg *types.ImageBuildOptions) error + type BuildRemove bool + func (u BuildRemove) Apply(cfg *types.ImageBuildOptions) error + type BuildTags []string + func (u BuildTags) Apply(cfg *types.ImageBuildOptions) error + type FileContents struct + Data []byte + GID int + Mode int64 + UID int + func (b *FileContents) SetMode(mode int64) + func (b *FileContents) SetOwners(uid int, gid int) + func (b FileContents) Get() ([]byte, error) + func (b FileContents) UpdateHeader(header *tar.Header) error + type LogConsumerWriter struct + func (l LogConsumerWriter) Write(p []byte) (n int, err error) + type PathContents interface + Get func() ([]byte, error) + SetMode func(mode int64) + SetOwners func(uid int, gid int) + UpdateHeader func(header *tar.Header) error + func PathContentsFromBytes(data []byte) PathContents + func PathContentsFromString(data string) PathContents + type RunCmdOpt interface + Apply func(cfg *types.ExecConfig) error + type RunCmdUser string + func (u RunCmdUser) Apply(cfg *types.ExecConfig) error + type RunOptions struct + AuthPassword string + AuthUsername string + Capabilities []string + Cmd []string + ContainerName string + CopyFromTo map[string]string + DoNotAutoRemove bool + Entrypoint []string + Env []string + ImageRepo string + ImageTag string + LogConsumer func(string) + LogStderr io.Writer + LogStdout io.Writer + NetworkID string + NetworkName string + OmitLogTimestamps bool + Ports []string + PostStart func(string, string) error + PreDelete bool + VolumeNameToMountPoint map[string]string + type Runner struct + DockerAPI *client.Client + RunOptions RunOptions + func NewServiceRunner(opts RunOptions) (*Runner, error) + func (d *Runner) BuildImage(ctx context.Context, containerfile string, containerContext BuildContext, ...) ([]byte, error) + func (d *Runner) CopyFrom(container string, source string) (BuildContext, *types.ContainerPathStat, error) + func (d *Runner) CopyTo(container string, destination string, contents BuildContext) error + func (d *Runner) GetNetworkAndAddresses(container string) (map[string]string, error) + func (d *Runner) RefreshFiles(ctx context.Context, containerID string) error + func (d *Runner) Restart(ctx context.Context, containerID string) error + func (d *Runner) RunCmdInBackground(ctx context.Context, container string, cmd []string, opts ...RunCmdOpt) (string, error) + func (d *Runner) RunCmdWithOutput(ctx context.Context, container string, cmd []string, opts ...RunCmdOpt) ([]byte, []byte, int, error) + func (d *Runner) Start(ctx context.Context, addSuffix, forceLocalAddr bool) (*StartResult, error) + func (d *Runner) StartNewService(ctx context.Context, addSuffix, forceLocalAddr bool, connect ServiceAdapter) (*Service, string, error) + func (d *Runner) StartService(ctx context.Context, connect ServiceAdapter) (*Service, error) + func (d *Runner) Stop(ctx context.Context, containerID string) error + type Service struct + Cleanup func() + Config ServiceConfig + Container *types.ContainerJSON + StartResult *StartResult + type ServiceAdapter func(ctx context.Context, host string, port int) (ServiceConfig, error) + type ServiceConfig interface + Address func() string + URL func() *url.URL + type ServiceHostPort struct + func NewServiceHostPort(host string, port int) *ServiceHostPort + func NewServiceHostPortParse(s string) (*ServiceHostPort, error) + func (s ServiceHostPort) Address() string + func (s ServiceHostPort) URL() *url.URL + type ServiceURL struct + func NewServiceURL(u url.URL) *ServiceURL + func NewServiceURLParse(s string) (*ServiceURL, error) + func (s ServiceURL) Address() string + func (s ServiceURL) URL() *url.URL + type StartResult struct + Addrs []string + Container *types.ContainerJSON + RealIP string