Hardened images

Integrating with Chainguard Containers

Chainguard, a Docker Verified Publisher, provides Chainguard Containers (previously known as Chainguard Images): minimal, hardened container images with zero CVEs, built-in SBOMs and signatures, and containing only the application and its runtime dependencies.

Proxy and cache these images in Cloudsmith by configuring a Chainguard upstream.

Chainguard provides Free container images (cgr.dev/chainguard) that are publicly available and tagged as :latest. They also provide Production container images (cgr.dev/) for versioned tags, FIPS images, and custom builds.

Upstream configuration

Form FieldDescription
NameA descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream.
PriorityThe weighting of the upstream source. Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date.
Proxy URLThe URL for this upstream source. This must be a fully qualified URL including any path elements required to reach the root of the repository.
Proxy OnlyProxy requests through to upstream sources in order to match assets that are not present in this repository.
Cache and ProxyProxy the initial request for an asset through to the upstream source and then store (cache) resolved assets in this repository for future requests.
AuthenticationSelect the authentication method required by this upstream. If the upstream does not require credentials, select None from the dropdown.
Headers (optional, under Additional options)Optional key-value headers that can be passed to upstreams with each request.
Verify SSL Certificates (under Additional options)If enabled, SSL certificates are verified when requests are made to this upstream. We recommend leaving this enabled for all public sources to help mitigate Man-In-The-Middle (MITM) attacks.

Adding Chainguard Containers as an upstream

You can integrate the Chainguard Containers registry into your Cloudsmith account by adding a Chainguard upstream.

Chainguard Production containers

To access Chainguard Production containers, you must configure the Chainguard registry as a private upstream using the username and password from a Chainguard pull token.

  1. In your Cloudsmith repository, go to the Sources tab.

  2. If you have existing upstreams configured, click + Configure new upstream.

  3. In the modal, select the Hardened images tab, then click the Chainguard Containers card.

  4. Select a tier: Free or Production.

  5. In the Name field, enter a descriptive name for the upstream.

  6. In the Priority field, specify a priority. See Upstream concepts: Priority.

  7. Leave the pre-filled Proxy URL as is (https://cgr.dev/chainguard for Free, https://cgr.dev/ for Production).

  8. Under Package delivery, select Cache and proxy.

  9. Under Authentication:

    • Free: select None.
    • Production: select Basic Auth and enter the username and password from a Chainguard pull token.
  10. (Optional) Click Additional options and add key-value headers to send with each request.

  11. Click + Add upstream.

    Your Chainguard upstream appears on the Upstream registries section of the Sources tab.

Pull a Chainguard container image with Docker native tooling

After you've configured an upstream, you can pull Chainguard images into Cloudsmith with the docker pull command.

Before you pull an image:

  1. Configure a Cloudsmith upstream for Chainguard by using the steps in Adding Chainguard Containers as an upstream.
  2. Verify that Docker is installed and running.
  3. In a terminal, log in to Docker with your Cloudsmith username and token:
bash
   docker login docker.cloudsmith.io

Pull a Chainguard Free image

To pull the nginx Free image, run:

bash
docker pull docker.cloudsmith.io/WORKSPACE/REPOSITORY/nginx:latest

Pull a Chainguard Production image

To pull the nginx Production image, run the following command. Replace CHAINGUARD-REGISTRY with your Chainguard registry path, and TAG with the versioned tag you want:

bash
docker pull docker.cloudsmith.io/WORKSPACE/REPOSITORY/CHAINGUARD-REGISTRY/nginx:TAG

Verify that the image appears in your Cloudsmith repository.