Documentation
¶
Index ¶
- func EnsureImage(ctx context.Context, cli *client.Client, imageRef string) error
- func Exec(ctx context.Context, cli *client.Client, containerID string, cmd []string, ...) error
- func NewClient(ctx context.Context, configuredHost string) (*client.Client, string, error)
- func RunContainer(ctx context.Context, cli *client.Client, cfg *container.Config, ...) error
- func RunContainerOnNetwork(ctx context.Context, cli *client.Client, cfg *container.Config, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureImage ¶
EnsureImage pulls imageRef when it is not already present on the daemon.
func Exec ¶
func Exec(ctx context.Context, cli *client.Client, containerID string, cmd []string, stdin io.Reader) error
Exec runs cmd inside an existing container through the Docker SDK.
func NewClient ¶
NewClient resolves a reachable Docker-compatible daemon and returns a client configured for it.
func RunContainer ¶
func RunContainer( ctx context.Context, cli *client.Client, cfg *container.Config, hostCfg *container.HostConfig, name string, ) error
RunContainer runs a short-lived helper container and removes it afterwards. On failure it includes captured container output in the returned error.
func RunContainerOnNetwork ¶
func RunContainerOnNetwork( ctx context.Context, cli *client.Client, cfg *container.Config, hostCfg *container.HostConfig, netCfg *network.NetworkingConfig, name string, ) error
RunContainerOnNetwork is like RunContainer but attaches the container to a named Docker network via netCfg. Pass nil for netCfg to use the default bridge network (equivalent to RunContainer).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.