Hosting ASP.NET Core Images with Docker over HTTPS
November 13, 2025 ยท View on GitHub
ASP.NET Core uses HTTPS by default. HTTPS relies on certificates for trust, identity, and encryption.
See Hosting ASP.NET Core images with Docker over HTTPS for HTTPS scenarios
Get certificates into a container
The instructions show how to bind-mount certificates into containers. We recommend certificates NOT be added into the image with a COPY command in a Dockerfile for the following reasons:
- It makes it harder to use the same image for testing with dev certificates and hosting with production certificates.
- It increases the risk of certificate disclosure if certificates are made part of your container image.