Documentation ¶
Overview ¶
Package docker providers an implementation of a Driver driver for job execution. Each job executed will be done in a separate container, a volume is used to persist state across these containers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Host string // The host running the Docker daemon. Version string // The version of the Docker API. Image string // The container image to use. Workspace string // The workspace in the container to mount the volume to. }
Config is the struct used for initializing a new Docker driver for build execution.
type Driver ¶
type Driver struct { io.Writer Host string // Host is the host of the Docker registry to use. Version string // Version is the Docker API version to use. Image string // Image is the name of the image to use in the Docker container. // Workspace specifies location on the Driver container to mount a volume // to so state can be persisted. Workspace string // contains filtered or unexported fields }
Driver provides an implementation of the runner.Dirver interface for running jobs within a Docker container.
func (*Driver) Create ¶
func (d *Driver) Create(c context.Context, env []string, objs runner.Passthrough, p runner.Placer) error
Create will create a volume, and pull down the configured image. The client to the Driver daemon is derived from the environment. Once the client has been established, the image volume is created, and the image is pulled down from the repository.
func (*Driver) Destroy ¶
func (d *Driver) Destroy()
Destroy will remove all containers created during job execution, and the volume. All of these operations are forced.
func (*Driver) Execute ¶
Execute performs the given runner.Job in a Driver container. Each job is turned into a shell script and placed onto an initial container. A subsequent container is then created, and the previously placed script is used as that new container's entrypoint. The logs for the container are forwarded to the underlying io.Writer.