docker

package
v0.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2016 License: BSD-2-Clause Imports: 9 Imported by: 2

README

Docker Builder

This a Builder implementation that builds Docker images inside Docker. So meta.

It does the following:

  1. Clones the GitHub repo.
  2. Pulls that last built docker image for the given branch.
  3. Builds a new image.
  4. Tags the new image with latest as well as the name of the branch and the git sha.
  5. Pushes the image to the docker registry.

Usage

This image expects that the following files to be present:

  • /var/run/conveyor/.dockercfg: .dockercfg file for credentials to use when pulling.
  • /var/run/conveyor/.ssh: Should container an id_rsa and id_rsa.pub file which gives access to pull GitHub repos.

Documentation

Index

Constants

View Source
const (
	// DefaultBuilderImage is the docker image used to build docker images.
	DefaultBuilderImage = "remind101/conveyor-builder"

	// DefaultDataVolume is the default name of a container serving as a
	// data volume for ssh keys and docker credentials. In general, you
	// shouldn't need to change this.
	DefaultDataVolume = "data"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// dataVolume is the name of the volume that contains ssh keys and
	// configuration data.
	DataVolume string
	// Name of the image to use to build the docker image. Defaults to
	// DefaultBuilderImage.
	Image string
	// Set to true to enable dry runs. This sets the `DRY` environment
	// variable within the builder container to `true`. The behavior of this
	// flag depends on how the builder image handles the `DRY` environment
	// variable.
	DryRun bool
	// contains filtered or unexported fields
}

Builder is a builder.Builder implementation that runs the build in a docker container.

func NewBuilder

func NewBuilder(c *docker.Client) *Builder

NewBuilder returns a new Builder backed by the docker client.

func NewBuilderFromEnv

func NewBuilderFromEnv() (*Builder, error)

NewBuilderFromEnv returns a new Builder with a docker client configured from the standard Docker environment variables.

func (*Builder) Build

func (b *Builder) Build(ctx context.Context, w io.Writer, opts builder.BuildOptions) (image string, err error)

Build executes the docker image.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL