A Buildkite plugin to build and push Docker images to a variety of container registries.
Supported providers:
- Amazon Elastic Container Registry (ECR)
- Google Artifact Registry (GAR)
- Buildkite Packages Container Registry
These are all the options available to configure this plugin's behaviour.
The registry provider to use. Supported values: ecr
, gar
, buildkite
.
The name of the Docker image to push (e.g., my-org/my-app
).
The tag for the Docker image.
Enable debug mode, which runs the plugin scripts with set -x
to provide detailed command tracing. Set to true
, on
, or 1
to enable.
The AWS region for the ECR registry.
The full URL of the ECR registry (e.g., 123456789012.dkr.ecr.us-east-1.amazonaws.com
).
Note: Authentication is handled by the gcloud
CLI. Ensure your Buildkite agent has authenticated with Google Cloud before running this plugin (e.g., using a service account key or Workload Identity Federation).
The Google Cloud project ID.
The GAR region (e.g., us-east1
) or a full GAR hostname (e.g., europe-west10-docker.pkg.dev
).
The name of the Artifact Registry repository. If omitted, it defaults to the image name.
Note: Authentication requires either a Buildkite API token with Read Packages and Write Packages scopes, or OIDC authentication using buildkite-agent
(available in Buildkite pipeline jobs).
The Buildkite organization slug. If omitted, it will use the BUILDKITE_ORGANIZATION_SLUG
environment variable.
The container registry slug. If omitted, it defaults to the image name.
Authentication method to use. Supported values: api-token
, oidc
.
api-token
: Uses theapi-token
parameter or falls back toBUILDKITE_API_TOKEN
environment variableoidc
: Usesbuildkite-agent oidc request-token
command (available in pipeline jobs)
The Buildkite API token with Read Packages and Write Packages scopes. Required when auth-method
is api-token
. Can also be provided via the BUILDKITE_API_TOKEN
environment variable for backward compatibility.
This example pushes an image to an ECR repository.
steps:
- label: ":docker: Build and Push"
plugins:
- docker-image-push#v1.0.0:
provider: ecr
image: my-app
ecr:
region: us-east-1
registry-url: 123456789012.dkr.ecr.us-east-1.amazonaws.com
This example pushes an image to a GAR repository with a specific tag.
steps:
- label: ":docker: Build and Push"
plugins:
- docker-image-push#v1.0.0:
provider: gar
image: my-app
tag: "v1.2.3"
gar:
project: my-gcp-project
region: australia-southeast1
repository: my-docker-repo
This example pushes an image to Buildkite Packages using API token authentication.
steps:
- label: ":docker: Build and Push"
plugins:
- docker-image-push#v1.0.1:
provider: buildkite
image: my-app
tag: "v1.2.3"
buildkite:
org-slug: my-org
registry-slug: my-container-registry
api-token: your-api-token-here
This example uses OIDC authentication (recommended for Buildkite pipelines).
steps:
- label: ":docker: Build and Push"
plugins:
- docker-image-push#v1.0.1:
provider: buildkite
image: my-app
buildkite:
org-slug: my-org
auth-method: oidc
Enable verbose mode for detailed debug output.
steps:
- label: ":docker: Build and Push (Debug)"
plugins:
- docker-image-push#v1.0.0:
provider: ecr
image: my-app
verbose: true
Elastic Stack | Agent Stack K8s | Hosted (Mac) | Hosted (Linux) | Notes |
---|---|---|---|---|
β | β | All β Requires awscli or gcloud for ECR and GAR respectively. Buildkite Packages only requires docker Hosted (Mac) - Docker engine not available |
- β Fully supported (all combinations of attributes have been tested to pass)
β οΈ Partially supported (some combinations cause errors/issues)- β Not supported
Contributions are welcome! Please open a pull request with your changes.
The package is available as open source under the terms of the MIT License.