Container

Buildkite Package Registries provides registry support for Docker and other Open Container Initiative (OCI) images. Buildkite registries follow the OCI Distribution Specification version 1.1.

Once your container source registry has been created, you can publish/upload images (generated from your application's build) to this registry via relevant docker commands presented on your container registry's details page.

To view and copy these docker commands:

  1. Select Package Registries in the global navigation to access the Registries page.
  2. Select your container source registry on this page.
  3. Select Publish a Container Image and in the resulting dialog, for each required docker command set in the relevant code snippets, copy the relevant code snippet (using the icon at the top-right of its code box), paste it into your terminal, and run it.

These Docker commands are used to:

  • Log in to your Buildkite container source registry with the API access token.
  • Tag your container image to be published.
  • Publish the image to your container source registry.

Publish an image

The following steps describe the process above:

  1. Copy the following docker login command, paste it into your terminal, and modify as required before running to log in to your container source registry:

    docker login packages.buildkite.com/{org.slug}/{registry.slug} -u buildkite -p registry-write-token
    

    where:

    • registry-write-token is your API access token used to publish/upload packages to your container source registry. Ensure this access token has the Read Packages and Write Packages REST API scopes, which allows this token to publish packages to any source registry your user account has access to within your Buildkite organization.
    • {org.slug} can be obtained from the end of your Buildkite URL, after accessing Package Registries or Pipelines in the global navigation of your organization in Buildkite.
    • {registry.slug} is the slug of your container source registry, which is the kebab-case version of this registry's name, and can be obtained after accessing Package Registries in the global navigation > your container source registry from the Registries page.
  2. Copy the following docker tag command, paste it into your terminal, and modify as required before running to tag your container image:

    docker tag current-image-name:tag packages.buildkite.com/{org.slug}/{registry.slug}/package-name:tag
    

    where:

    • current-image-name:tag is the existing image-name:tag combination of your container image name and its current tag to published to your container source registry. The :tag component can be optional. This component of this command also supports the other tag syntax references mentioned in the docker tag documentation.
    • image-name:tag is the image name and tag to provide to this image when it is published to your source container registry, where the :tag part of this command is optional.
  3. Copy the following docker push command, paste it into your terminal, and modify as required before running to push your container image:

    docker push packages.buildkite.com/{org.slug}/{registry.slug}/package-name:tag
    

    where package-name:tag is the image name and tag combination you configured in the previous step.

Access an image's details

A container image's details can be accessed from its source registry through the Releases (tab) section of your container source registry page. To do this:

  1. Select Package Registries in the global navigation to access the Registries page.
  2. Select your container source registry on this page.
  3. On your container source registry page, select the image to display its details page.

The image's details page provides the following information in the following sections:

  • Installation (tab): the installation instructions.
  • Contents (tab, where available): a list of directories and files contained within the image.
  • Details (tab): a list of checksum values for this image—MD5, SHA1, SHA256, and SHA512.
  • About this version: a brief (metadata) description about the image.
  • Details: details about:

    • the name of the image (typically the file name excluding any version details and extension).
    • the image version.
    • the source registry the image is located in.
    • the image's visibility (based on its registry's visibility)—whether the image is Private and requires authentication to access, or is publicly accessible.
    • the distribution name / version.
    • additional optional metadata contained within the image, such as a homepage, licenses, etc.
  • Pushed: the date when the last image was uploaded to the source registry.

  • Total files: the total number of files (and directories) within the image.

  • Dependencies: the number of dependency images required by this image.

  • Package size: the storage size (in bytes) of this image.

  • Downloads: the number of times this image has been downloaded.

Downloading an image

A container image can be downloaded from the image's details page. To do this:

  1. Access the package's details.
  2. Select Download.

Installing an image

A container image can be obtained using code snippet details provided on the image's details page. To do this:

  1. Access the image's details.
  2. Ensure the Installation > Instructions section is displayed.
  3. For each required command in the relevant code snippets, copy the relevant code snippet, paste it into your terminal, and run it.

The following set of code snippets are descriptions of what each code snippet does and where applicable, its format:

Registry configuration

If your registry is private (that is, the default registry configuration), log in to the container registry containing the image to obtain with the following docker login command:

docker login packages.buildkite.com/{org.slug}/{registry.slug} -u buildkite -p registry-read-token

where:

  • {org.slug} can be obtained from the end of your Buildkite URL, after accessing Package Registries or Pipelines in the global navigation of your organization in Buildkite.
  • {registry.slug} is the slug of your registry, which is the kebab-case version of your registry name, and can be obtained after accessing Package Registries in the global navigation > your registry from the Registries page.
  • registry-read-token is your API access token or registry token used to download images from your container registry. Ensure this access token has the Read Packages REST API scope, which allows this token to download images from any registry your user account has access to within your Buildkite organization.

This step is not required for public container registries.

Package installation

Use the following docker pull command to obtain the image:

docker pull packages.buildkite.com/{org.slug}/{registry.slug}/image-name:tag

where:

  • {org.slug} can be obtained from the end of your Buildkite URL, after accessing Package Registries or Pipelines in the global navigation of your organization in Buildkite.
  • {registry.slug} is the slug of your registry, which is the kebab-case version of your registry name, and can be obtained after accessing Package Registries in the global navigation > your registry from the Registries page.
  • image-name is the name of your image.

  • tag is the tag associated with this image.