diff --git a/README.md b/README.md index 67726d2..454b6c9 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ The following is just an example of how your Dockerfile could look like. ```sh # Password for the certificate # this image contains the entire .NET SDK and is ideal for creation the build -FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine-amd64 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:10.0-alpine-amd64 AS build-env WORKDIR /App COPY . ./ # Restore dependencies for your application @@ -46,7 +46,7 @@ ENTRYPOINT ["dotnet", "test.dll"] |-----------------------------------------------------|-------------------------------------------------------------------------|----------------------------------------------------------------------------------------------| | ASPNETCORE_Kestrel__Certificates__Default__Path | The path containing the server certificate | /usr/local/share/ca-certificates/aspnetapp.crt | | ASPNETCORE_Kestrel__Certificates__Default__KeyPath | The path containing the key for the server certificate | /usr/local/share/ca-certificates/aspnetapp.key | -| ASPNETCORE_Kestrel__Certificates__Default__Password | The password for required for the server key | N/A (generated at build time) | +| ASPNETCORE_Kestrel__Certificates__Default__Password | The password for required for the server key | N/A (generated at build time through CERT_PASSWORD argument) | | CERTIFICATES_DIRECTORY | The directory where the certificate files are stored for the web server | /usr/local/share/ca-certificates | | ASPNETCORE_URLS | Specifies at which urls and ports the Kestrel server should listen | http://+:80;https://+:443 | | DOTNET_CLI_TELEMETRY_OPTOUT | Disables telemetry | 1 | @@ -90,11 +90,13 @@ Depending on your use-case you event might consider to use docker networking in ### Included certificate -The included certificate is generated through the _dotnet dev-certs_ command. This is a very convenient and suitable way to generate development certificates through the dotnet SDK. +The included certificate is generated through the _dotnet dev-certs_ command. This is a very convenient and suitable way to generate development certificates using the .NET SDK. + +The build pipeline generates a random certificate password using `openssl rand -base64 12` and passes it to the Docker build through the CERT_PASSWORD build argument. The password is therefore different for each pipeline build. + +Because the password is embedded in the resulting image configuration, it can be retrieved by inspecting the image. +This is acceptable for development purposes but it is not suitable for production use. -The password used to generate the certificate is randomly generated through the `openssl rand -base64 12` at build time. -If you inspect the image layers you'll able to easily see it. -I think this is fine for development purposes and just want to get things up and running, although this is not recommended for production use at all. You can generate your own password and certificates in the following way : ```sh @@ -103,7 +105,7 @@ openssl rand -base64 12 # use the .net cli to generate your own certificates with your chosen password dotnet dev-certs https --export-path /config/aspnetapp.pem --password "YOUR PASSWORD" --format PEM ``` -After this you only need to map your own certificates with the **ASPNETCORE_Kestrel__Certificates__** variables. +Afterwards, configure your own certificate with the **ASPNETCORE_Kestrel__Certificates__** variables. ### Versioning