Report this

What is the reason for this report?

How to use the certificate generated by DigitalOcean in a docker container?

Posted on November 26, 2019

I have a web site running in a docker container and I can use a self-signed certificate in it:

  web:
    ...
    environment:
      ASPNETCORE_URLS: ${ASPNETCORE_URLS}
      ASPNETCORE_Kestrel__Certificates__Default__Password: ${ASPNETCORE_KESTREL_CERTIFICATE_PASSWORD}
      ASPNETCORE_Kestrel__Certificates__Default__Path: ${ASPNETCORE_KESTREL_CERTIFICATE_PATH}
    ports:
      - "443:443"
    volumes:
      - ${CERTIFICATE_PATH}:/root/.dotnet/https

This works fine (with the self signed certificate alert in the browsers).

Now I’m trying to use DigitalOcean’s certificates in that web site.

I’ve redirected my hostname to DigitalOcean’s hostnames and generated a certificate at “account/security”. Ping and whois give the expected results.

Now I would like to tell the docker container to use that certificate I’ve just created instead of the self-signed certificate but I can’t find where does DigitalOcean store the certificates it creates&manages.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.