Documentation ¶
Index ¶
- func PolicyRoot() string
- type DockerClient
- func (dc *DockerClient) IsRunning(name string) (bool, error)
- func (dc *DockerClient) Pull(image, platform string) error
- func (dc *DockerClient) RemoveImage(image string) error
- func (dc *DockerClient) Run(opts ...RunOption) error
- func (dc *DockerClient) Start(opts ...RunOption) error
- func (dc *DockerClient) Stop(name string) error
- type RunOption
- func WithAutoRemove() RunOption
- func WithCmd(cmds []string) RunOption
- func WithContainerHostname(hostname string) RunOption
- func WithContainerImage(image string) RunOption
- func WithContainerName(name string) RunOption
- func WithContainerPlatform(goos, goarch string) RunOption
- func WithEntrypoint(args []string) RunOption
- func WithEnv(env string) RunOption
- func WithEnvs(envs []string) RunOption
- func WithError(e io.Writer) RunOption
- func WithOutput(o io.Writer) RunOption
- func WithPort(port string) RunOption
- func WithPorts(ports []string) RunOption
- func WithVolume(volume string) RunOption
- func WithVolumes(volumes []string) RunOption
- func WithWorkingDir(wd string) RunOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PolicyRoot ¶ added in v0.30.24
func PolicyRoot() string
Types ¶
type DockerClient ¶ added in v0.31.5
type DockerClient struct {
// contains filtered or unexported fields
}
func New ¶ added in v0.31.5
func New() (*DockerClient, error)
func (*DockerClient) IsRunning ¶ added in v0.31.5
func (dc *DockerClient) IsRunning(name string) (bool, error)
IsRunning returns if container with `name` is running.
func (*DockerClient) Pull ¶ added in v0.31.5
func (dc *DockerClient) Pull(image, platform string) error
Pull container image.
func (*DockerClient) RemoveImage ¶ added in v0.31.5
func (dc *DockerClient) RemoveImage(image string) error
Remove container image as image-name:tag.
func (*DockerClient) Run ¶ added in v0.31.5
func (dc *DockerClient) Run(opts ...RunOption) error
Run starts a container like `docker run` using the provided settings.
func (*DockerClient) Start ¶ added in v0.31.5
func (dc *DockerClient) Start(opts ...RunOption) error
Starts starts a container like `docker start` using the provided settings.
func (*DockerClient) Stop ¶ added in v0.31.5
func (dc *DockerClient) Stop(name string) error
Stop container instance with `name`.
type RunOption ¶ added in v0.31.5
type RunOption func(*runner)
func WithAutoRemove ¶ added in v0.31.5
func WithAutoRemove() RunOption
WithAutoRemove, automatically remove container when it exits.
func WithContainerHostname ¶ added in v0.31.5
func WithContainerImage ¶ added in v0.31.5
func WithContainerName ¶ added in v0.31.5
func WithContainerPlatform ¶ added in v0.31.5
func WithEntrypoint ¶ added in v0.31.5
func WithOutput ¶ added in v0.31.5
func WithVolume ¶ added in v0.31.5
func WithVolumes ¶ added in v0.31.5
func WithWorkingDir ¶ added in v0.31.5
Click to show internal directories.
Click to hide internal directories.