DirectorySecurity AdvisoriesPricing
Sign in
Directory
dotnet-sdk logo

dotnet-sdk

packaged by Chainguard

Last changed
Try a starter image for free
docker pull cgr.dev/chainguard/dotnet-sdk

Need access to a specific tag? Contact us.

Create your free account

Pull CVE-free container images and gain access to malware-resistant Python, Java, and JavaScript libraries rebuilt from verified source.

Sign up
Tags
Overview
Comparison
Provenance
Specifications
SBOM
Vulnerabilities
Advisories

Chainguard Container for dotnet-sdk

Minimal container image for .NET and the .NET Tools.

Chainguard Containers are regularly-updated, secure-by-default container images.

Download this Container Image

For those with access, this container image is available on cgr.dev:

docker pull cgr.dev/ORGANIZATION/dotnet-sdk:latest

Be sure to replace the ORGANIZATION placeholder with the name used for your organization's private repository within the Chainguard Registry.

Compatibility Notes

Chainguard's .NET Images are comparable to the .NET images available from Microsoft. Like most Chainguard images, the .NET images come with only the minimum dependencies needed to function and do not include things like a shell or package manager.

The Chainguard .NET images are available on cgr.dev as two variants: dotnet-sdk and dotnet-runtime. The SDK variant contains additional tooling to facilitate development and building, while the runtime variant contains only the runtime to execute .NET applications. Both the SDK and Runtime images also have latest-dev versions that contain a shell and various other tools for development.

OpenSSL Versions

.NET on Linux takes its cryptography from the system OpenSSL libraries. The default dotnet tags for .NET 10 and earlier, such as :10, :9, and :8, currently carry both OpenSSL 4.0 and OpenSSL 3.6. .NET 8 and .NET 9 will not gain support for OpenSSL 4.x, so applications on those versions always use the OpenSSL 3.x libraries. From .NET 11 on, the default tags carry OpenSSL 4.0 only.

Tags with an -ossl35 suffix are now available, such as :latest-ossl35, :10-ossl35, :10-slim-ossl35, and :8-ossl35. These variants use a hardened build of OpenSSL 3.5 instead of OpenSSL 3.6. From .NET 11 on, they are the tags for software that still needs OpenSSL 3.x, such as a self-contained application that bundles an older .NET runtime. To pull one, run the following command:

docker pull cgr.dev/ORGANIZATION/dotnet-runtime:10-ossl35

.NET 10 and later support the DOTNET_OPENSSL_VERSION_OVERRIDE environment variable, which switches a .NET application at runtime between the OpenSSL 4.x and 3.x libraries. Set it to 4 to use the OpenSSL 4.x libraries, or to 3 to use the OpenSSL 3.x libraries. For example, the following Dockerfile makes an application load the OpenSSL 3.x libraries:

FROM cgr.dev/ORGANIZATION/dotnet-runtime:10-ossl35
ENV DOTNET_OPENSSL_VERSION_OVERRIDE=3

Chainguard Hardening

The OpenSSL 4.0 libraries in these images do not provide the Triple DES (3DES) cipher by default. Setting the CHAINGUARD_LEGACY_ENABLE_DES environment variable to 1 makes it available to a process.

Upstream .NET on Linux writes PKCS#12 (PFX) files that are protected with Triple DES by default. From .NET 11 on, Chainguard's .NET runtime protects them with AES-256 instead. X509Certificate2.Export and X509Certificate2Collection.Export with X509ContentType.Pfx use the same parameters as ExportPkcs12(Pkcs12ExportPbeParameters.Default, password): PBES2 with AES-256-CBC and HMAC-SHA256, and an HMAC-SHA256 integrity check. Self-contained applications that bundle a .NET runtime from Microsoft keep the upstream default.

With OpenSSL 4.0, two uses of Triple DES still need the variable:

  • loading a PKCS#12 file that is protected with Triple DES, such as a file that upstream .NET wrote;
  • writing such a file on purpose, with ExportPkcs12(Pkcs12ExportPbeParameters.Pkcs12TripleDesSha1, password), for software that cannot read AES-protected PKCS#12 files.

Instead of enabling Triple DES in an application, you can convert its Triple DES files to AES-256 once, where the openssl command-line tool is available. The following commands take the password from the PFX_PASSWORD environment variable. The first command, the only one that needs CHAINGUARD_LEGACY_ENABLE_DES, writes the certificate and its encrypted private key to legacy.pem. The second writes converted.pfx with the AES-256 defaults of the openssl tool:

CHAINGUARD_LEGACY_ENABLE_DES=1 openssl pkcs12 -in legacy.pfx -passin env:PFX_PASSWORD -passout env:PFX_PASSWORD -out legacy.pem
openssl pkcs12 -export -in legacy.pem -passin env:PFX_PASSWORD -passout env:PFX_PASSWORD -out converted.pfx
rm legacy.pem

.NET 10 and earlier keep the upstream default. On .NET 10, which uses OpenSSL 4.0 by default, the default PKCS#12 export fails unless CHAINGUARD_LEGACY_ENABLE_DES is set to 1. In the default tags, setting DOTNET_OPENSSL_VERSION_OVERRIDE to 3 also works, because OpenSSL 3.6 provides Triple DES.

dotnet dev-certs https saves its new certificate through the default PKCS#12 export, and the tool in the .NET 10 and .NET 11 SDK images does not have the AES-256 default yet. Create the certificate once with the variable set:

CHAINGUARD_LEGACY_ENABLE_DES=1 dotnet dev-certs https

The certificate store keeps the certificate protected with AES-256, so later commands such as dotnet dev-certs https --check do not need the variable. Exporting the certificate with --export-path in the PFX format needs the variable as well, and the PEM format (--format Pem) does not.

Image Variants and Tags

  • Standard (:latest, :10, …): Drop-in compatible with upstream
  • Slim (:latest-slim, :10-slim, …): Smaller than standard, with no shell or package manager, run the process directly

To download the SDK image, you would run a command like the following:

docker pull cgr.dev/$ORGANIZATION/dotnet-sdk:latest

And to download the Runtime image, you would run the following:

docker pull cgr.dev/$ORGANIZATION/dotnet-runtime:latest

For simple cases, you can use the SDK image directly, or with a multi-stage build using the SDK image as the builder and the Runtime image as the final target container.

Supported SDK Feature Bands

TL;DR: Chainguard's .NET SDK images provide 1xx feature bands exclusively. We are looking into providing tags for our SDK images with other feature bands, but due to technical limitations, we aren't doing so today.

Each release of the .NET project is versioned according to the runtime (i.e 9.0.8) and each release includes one or more 'feature bands' of the SDK (i.e 9.0.109, 9.0.304). The download page for .NET 9.0 illustrates this.

The SDK images provided by Microsoft are tagged such that the SDK is tagged with the version of the most recent feature band (i.e mcr.microsoft.com/dotnet/sdk:9.0.304).

It has been difficult for Chainguard to reliably provide additional feature bands for various technical reasons. And Microsoft has, in some cases, changed how they tag their source code repositories, disrupting how our packages are versioned and, resultantly, how our images are tagged.

We are working on changes to provide additional feature bands with our .NET SDK image (i.e 9.0.109, 9.0.304). However, until those changes are implemented, our dotnet-sdk image will include, and will be tagged exclusively, with the version of the 1xx feature band (i.e 9.0.109).

Getting Started

Begin by going to your .NET application directory (or the location where you house your .NET applications) and execute the following command. This command will detect the .NET project in your directory and create a base for the Docker initialization:

docker init

This command will create the following files:

Dockerfile
compose.yaml
README.Docker.md
.dockerignore

After the files have been created, replace the contents within the created Dockerfile with the following

FROM cgr.dev/ORGANIZATION/dotnet-sdk:latest AS build

COPY --chown=nonroot:nonroot . /source

WORKDIR /source

RUN dotnet publish --use-current-runtime --self-contained false -o Release

# If you are running an ASPNET project, you can instead pull our ASPNET image cgr.dev/ORGANIZATION/aspnet-runtime:latest
FROM cgr.dev/ORGANIZATION/dotnet-runtime:latest AS final
WORKDIR /

COPY --from=build source .

ENTRYPOINT ["dotnet", "Release/dotnet.dll"]

Note that if your project resides in a sub directory, make sure you are pointing to that directory. For example, if your project resided in a directory called 'app', you would set the destination to /source/app.

This will build your application using the SDK image and then copy the built application over to the Runtime image which will then start.

You can run and publish a local image with the following command:

docker compose up -d --build

You can also remove the container using the following command:

docker compose down

Documentation and Resources

What are Chainguard Containers?

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.

Need additional packages?

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.

Learn More

Refer to our Chainguard Containers documentation on Chainguard Academy. Chainguard also offers VMs and Libraries — contact us for access.

Trademarks

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.

Licenses

Chainguard's container images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" tag of this image:

    For a complete list of licenses, please refer to this Image's SBOM.

    Software license agreement

    Compliance

    Chainguard Containers are SLSA Level 3 compliant with detailed metadata and documentation about how it was built. We generate build provenance and a Software Bill of Materials (SBOM) for each release, with complete visibility into the software supply chain.

    SLSA compliance at Chainguard

    This image helps reduce time and effort in establishing PCI DSS 4.0 compliance with low-to-no CVEs.

    PCI DSS at Chainguard

    A FIPS validated version of this image is available for FedRAMP compliance. STIG is included with FIPS image.

    Image contains multiple maintained release tracks and is eligible for end of life support.


    Related images
    dotnet-sdk-fips logoFIPS

    dotnet-sdk-fips


    Category
    Free
    Base

    The trusted source for open source

    Talk to an expert
    PrivacyTerms

    Product

    Chainguard ContainersChainguard LibrariesChainguard VMsChainguard OS PackagesChainguard ActionsChainguard Agent SkillsIntegrationsPricing
    © 2026 Chainguard, Inc. All Rights Reserved.
    Chainguard® and the Chainguard logo are registered trademarks of Chainguard, Inc. in the United States and/or other countries.
    The other respective trademarks mentioned on this page are owned by the respective companies and use of them does not imply any affiliation or endorsement.