1. Resources
  2. /
  3. Plugins
  4. /
  5. docker-build-buildkite-plugin

docker-build

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.

Example

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.

Configuration

dockerfile (Optional, string)

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.

context (Optional, string)

Path to the context directory to use. If not specified, the plugin will use the . directory as the context path.

secret-file (Optional, string)

A string like ‘id=mysecret,src=secret-file’ where is the path in the build (This enables Docker Buildkit, also)

tags (Optional, array of strings)

Tags to use when building the container. The plugin may also populate these tags with metadata generated by the docker-metadata plugin.

labels (Optional, array of strings)

Labels to use when building the container. The plugin may also populate these labels with metadata generated by the docker-metadata plugin.

build-args (Optional, array of strings)

Build arguments to use when building the container.

e.g. build-args: ['FOO=bar', 'BAZ=qux']

push (Optional, boolean)

If set to true, the plugin will push the container to a registry. Defaults to false.

Developing

To run the tests:

make test

Contributing

  1. Fork the repo
  2. Make the changes
  3. Run the tests
  4. Commit and push your changes
  5. Send a pull request

The plugins listed on this webpage are provided for informational purposes only. They have not undergone any formal security review or assessment. While we strive to provide useful resources, we cannot guarantee the safety, reliability, or integrity of these plugins. Users are strongly advised to conduct their own security evaluations before downloading, installing, or using any plugin. By using these plugins, you acknowledge and accept any risks associated with their use. We disclaim any liability for any harm or damages arising from the use of the plugins listed.

Start turning complexity into an advantage

Create an account to get started with a 30-day free trial. No credit card required.

Buildkite Pipelines

Platform

  1. Pipelines
  2. Pipeline templates
  3. Public pipelines
  4. Test Engine
  5. Package Registries
  6. Mobile Delivery Cloud
  7. Pricing

Hosting options

  1. Self-hosted agents
  2. Mac hosted agents
  3. Linux hosted agents

Resources

  1. Docs
  2. Blog
  3. Changelog
  4. Webinars
  5. Plugins
  6. Case studies
  7. Events
  8. Migration Services
  9. Comparisons

Company

  1. About
  2. Careers
  3. Press
  4. Brand assets
  5. Contact

Solutions

  1. Replace Jenkins
  2. Workflows for AI/ML
  3. Testing at scale
  4. Monorepo mojo
  5. Bazel orchestration

Legal

  1. Terms of Service
  2. Acceptable Use Policy
  3. Privacy Policy
  4. Subprocessors
  5. Service Level Agreement

Support

  1. System status
  2. Forum
© Buildkite Pty Ltd 2025