Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DockerClient ¶
type DockerClient struct {
// contains filtered or unexported fields
}
DockerClient wraps a Docker client instance and provides methods to pull images and start containers.
func NewDockerClient ¶
func NewDockerClient() (h *DockerClient, err error)
NewDockerClient creates a new DockerClient. To configure the client, use environment variables: DOCKER_HOST, DOCKER_API_VERSION, DOCKER_CERT_PATH and DOCKER_TLS_VERIFY are supported.
func (*DockerClient) Run ¶
Run creates a new Docker container from the given image tag, mounts the working directory into it, and executes the given command in it.
func (*DockerClient) SetImages ¶
func (dc *DockerClient) SetImages(ctx context.Context, alwaysPull bool, tags ...string) ([]string, error)
SetImages ensures that the given image tags are present on the Docker host (missing images are pulled automatically). Existing images are not updated, unless alwaysPull is true.
If stdout is a terminal, download progress is reported.
SetImages also sets the DockerClients allow list from which containers are started.