I am aware, self signed cert should be written in docker file etc:
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base WORKDIR /app COPY <my path>/<cert name>.crt /usr/local/share/ca-certificates/<cert name>.crt RUN update-ca-certificates
I decided to remove the above mentioned line of codes (line 2 and 3) and intend to install the crt as follows:
In the power shell
docker cp <location of the .crt> <image id>:/usr/local/share/ca-certificates/<filename>.crt
Go to the docker image’s CLI and, in /app, run
And then restart the affected container.
I tried to curl the link. I encounter this error:
curl: (77) schannel: next InitializeSecurityContext failed: SEC_E_UNTRUSTED_ROOT (0x80090325) - The certificate chain was issued by an authority that is not trusted.
What are steps I’ve missed? I also have install the .pfx in the trusted root in Windows 10 and the container is running as Linux container.
Also anyone mind sharing how one updates their crt in docker container when the crt is about to expiry?