Last changed
docker pull cgr.dev/chainguard/rust
Need access to a specific tag? Contact us.
Integrate Chainguard into your developer workflows, manage your image versions to stay free of CVEs, and view critical SBOM and provenance details.
Sign upMinimal Wolfi-based Rust image for building Rust applications.
Chainguard Containers are regularly-updated, secure-by-default container images.
For those with access, this container image is available on cgr.dev
:
Be sure to replace the ORGANIZATION
placeholder with the name used for your organization's private repository within the Chainguard Registry.
This image contains the tools needed to build Rust code. This includes:
rustc
cargo
cargo-auditable
wrapperrustdoc
rustlldb
rust-audit-info
This image also includes a shell for compatibility with most cargo
package installations.
This image is not intended to be used as a runtime image, only as a build tool.
This will automatically pull the image to your local system and execute the command rustc --version
:
You should get output similar to this:
By default /usr/local/bin/cargo
contains a wrapper to always call cargo auditable
which generates and embeds build time crate information in the compiled binaries. This enables inspecting compiled rust binaries with rust-audit-info
which is also included in this image. Many security scanners also know how to parse this information for the purpose of detecting security vulnerabilities. For more information see Cargo Auditable project.
Building without audit information is possible by invoking /usr/bin/cargo
directly, however doing that will evade scanner support in the resulting binaries.
For runtime, you can use a multi-stage Dockerfile or similar technique to run your compiled binaries on
an even more slimmed down image.
The exact image will depend on your application, but static
or glibc-dynamic
should work.
This sample Dockerfile shows how to get a basic build up and running on glibc-dynamic
.
There's one build argument, PACKAGE
, that needs to be replaced with the name of your rust package.
If you're interested in enterprise support, SLAs, and access to older tags, get in touch.
Chainguard's free tier of Starter container images are built with Wolfi, our minimal Linux undistro.
All other Chainguard Containers are built with Chainguard OS, Chainguard's minimal Linux operating system designed to produce container images that meet the requirements of a more secure software supply chain.
The main features of Chainguard Containers include:
For cases where you need container images with shells and package managers to build or debug, most Chainguard Containers come paired with a development, or -dev
, variant.
In all other cases, including Chainguard Containers tagged as :latest
or with a specific version number, the container images include only an open-source application and its runtime dependencies. These minimal container images typically do not contain a shell or package manager.
Although the -dev
container image variants have similar security features as their more minimal versions, they include additional software that is typically not necessary in production environments. We recommend using multi-stage builds to copy artifacts from the -dev
variant into a more minimal production image.
To improve security, Chainguard Containers include only essential dependencies. Need more packages? Chainguard customers can use Custom Assembly to add packages, either through the Console, chainctl
, or API.
To use Custom Assembly in the Chainguard Console: navigate to the image you'd like to customize in your Organization's list of images, and click on the Customize image button at the top of the page.
Refer to our Chainguard Containers documentation on Chainguard Academy. Chainguard also offers VMs and Libraries — contact us for access.
This software listing is packaged by Chainguard. The trademarks set forth in this offering are owned by their respective companies, and use of them does not imply any affiliation, sponsorship, or endorsement by such companies.
Chainguard container images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" tag of this image:
Apache-2.0
BSD-2-Clause
BSD-3-Clause
CC-BY-4.0
GCC-exception-3.1
GPL-2.0
GPL-2.0-only
For a complete list of licenses, please refer to this Image's SBOM.
Software license agreement