A Buildkite plugin for running pipeline steps in Docker containers
The buildkite-agent
command line tool (and required environment variables) will also be mounted into the container, allowing you to use it for artifact download, etc.
If you need more control, please see the docker-compose Buildkite Plugin.
The docker container has the host buildkite-agent binary mounted in to /usr/bin/buildkite-agent
and the required environment variables set.
The following pipeline will run yarn install
and yarn run test
inside a Docker container using the node:7 Docker image:
steps:
- command: yarn install && yarn run test
plugins:
docker#v1.0.0:
image: "node:7"
workdir: /app
You can pass in additional environment variables:
steps:
- command: yarn install && yarn run test
plugins:
docker#v1.0.0:
image: "node:7"
workdir: /app
environment:
- MY_SPECIAL_VALUE=1
The name of the Docker image to use.
Example: node:7
The working directory where the pipeline’s code will be mounted to, and run from, inside the container.
Example: /app
Whether to automatically mount the buildkite-agent
binary from the host agent machine into the container. Defaults to true
. Set to false
if you want to disable, or if you already have your own binary in the image.
Extra environment variables to pass to the docker container, in an array of KEY=VALUE params.
MIT (see LICENSE)