Integrations
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 Field | Description |
|---|---|
| Name | A descriptive name for this upstream source. A shortened version of this name will be used for tagging cached packages retrieved from this upstream. |
| Priority | The weighting of the Upstream source. Upstream sources are selected for resolving requests by sequential order (1..n), followed by creation date. |
| Proxy URL | The 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 Only | Proxy requests through to upstream sources in order to match assets that are not present in this repository. |
| Cache and Proxy | Proxy the initial request for an asset through to the upstream source and then store (cache) resolved assets in this repository for future requests. |
| Verify SSL Certificates | 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. |
| Authentication (optional) | Optional credentials that can be provided if the upstream is not publicly accessible. |
| Headers (optional) | Optional key-value headers that can be passed to upstreams with each request. |
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.
- In your Cloudsmith repository, go to the Sources tab.
- If you have existing upstreams configured, click + Configure new upstream.
-
To add pre-configured Chainguard Free containers:
- Select the Pre-configured tab.
- Select the Chainguard Containers (Free) format.
-
Click + Add 1 upstream.
Your Chainguard upstream appears on the Upstream registries section of the Sources tab.
-
To add Chainguard Production containers:
- In the modal, select the Hardened images tab.
- Click the Chainguard Containers (Production) card.
- In the Name field, enter a descriptive name for the upstream.
- In the Priority field, specify a priority for the upstream. For more information about upstream priority, see Upstream concepts: Priority.
- The Proxy URL field is pre-filled with the Chainguard registry URL:
https://cgr.dev/. - Under Package delivery, select Cache and proxy.
- Click Additional options.
- Under Source type, select Private.
- Under Authentication type, select Basic Auth and enter the username and password from a Chainguard pull token.
- (Optional) In the Headers section, add key-value headers to pass to the upstream with each request.
- Select the Verify SSL Certificates option to ensure that SSL certificates are verified.
- 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.
Pull a Chainguard Free container with Docker native tooling
To pull the nginx Chainguard Free container image into Cloudsmith:
- Configure a Cloudsmith upstream for Chainguard by using the steps described in Adding Chainguard Containers as an upstream.
- Verify that Docker is installed and running.
- In a terminal, log in to Docker with your Cloudsmith username and token:
bash
docker login docker.cloudsmith.io - Pull the
nginximage by running the following command:bashdocker pull docker.cloudsmith.io/WORKSPACE/REPOSITORY/nginx:latest - Verify that the image appears in your Cloudsmith repository.
Pull a Chainguard Production container image with Docker native tooling
To pull the nginx Chainguard Production image into Cloudsmith:
- Configure a Cloudsmith upstream for Chainguard by using the steps described in Adding Chainguard Containers as an upstream.
- Verify that Docker is installed and running.
- In a terminal, log in to Docker with your Cloudsmith username and token:
bash
docker login docker.cloudsmith.io - Pull the
nginximage by running the following command:bashdocker pull docker.cloudsmith.io/WORKSPACE/REPOSITORY/CHAINGUARD-REGISTRY/nginx:latest - Verify that the image appears in your Cloudsmith repository.