This Buildkite plugin will build a container given a Dockerfile, a context path and a tag or a set of tags. It also accepts tags and labels generated by the docker-metadata
BuildKite plugin.
Add the following to your pipeline.yml
:
steps:
- command: ls
plugins:
- equinixmetal-buildkite/docker-build#v1.0.0:
tags:
- 'my-org/my-image:latest'
The default settings will build a container with a tag my-org/my-image:latest
given that the repository continers a Dockerfile
file on the top of the git repository root. It will also use the .
directory as the context path.
The following example will shows how this plugin can be integrated with the docker-metadata
plugin.
steps:
- command: ls
plugins:
- equinixmetal-buildkite/docker-metadata#v0.1.2:
images:
- 'my-org/my-image'
extra_tags:
- latest
- equinixmetal-buildkite/docker-build#v1.0.0: {}
This will build a container in a similar fashion as the example above. Except that it will also generate a tag with the commit hash, as well as labels that help triage where the commit came from.
Path to the Dockerfile to use. If not specified, the plugin will look for a Dockerfile
file on the top of the git repository root.
Path to the context directory to use. If not specified, the plugin will use the .
directory as the context path.
A string like 'id=mysecret,src=secret-file' where is the path in the build (This enables Docker Buildkit, also)
Tags to use when building the container. The plugin may also populate these tags with metadata generated by the docker-metadata
plugin.
Labels to use when building the container. The plugin may also populate these labels with metadata generated by the docker-metadata
plugin.
Build arguments to use when building the container.
e.g. build-args: ['FOO=bar', 'BAZ=qux']
If set to true
, the plugin will push the container to a registry. Defaults to false
.
To run the tests:
make test
- Fork the repo
- Make the changes
- Run the tests
- Commit and push your changes
- Send a pull request