Docker Community Forums

Share and learn in the Docker community.

Secure Docker behind NGinX with self-signed certificate and Nexus 3


(Odupre) #1

Hi all,

I am trying to setup my Sonatype Nexus 3 as a docker registry.
I am using NGinX in front of Nexus.

I just followed that tutorial: to generate a couple of certificates.
I setup my NginX as follow:
ssl config - customize as per your setup
ssl_certificate /home/agorha-ic/certificates/adgroupe.priv/server-cert.pem;
ssl_certificate_key /home/agorha-ic/certificates/adgroupe.priv/server-key.pem;
ssl_trusted_certificate /home/agorha-ic/certificates/adgroupe.priv/ca.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_dhparam /home/agorha-ic/certificates/adgroupe.priv/dhparam.pem;

    ssl_stapling                    on;
    ssl_stapling_verify             on;

    add_header                      Strict-Transport-Security max-age=15768000;

But each time I’m trying to login to nexus with docker, it complains that the certificate is signed by an unknown authority.
Error response from daemon: Get https://nexus.adgroupe.priv/v1/users/: x509: certificate signed by unknown authority

I just don’t understand what I should do. I tried to put my CA and certificates in “/etc/docker/certs.d/nexus.adgroupe.priv” and in “/usr/local/share/ca-certificates/”, I tried to add --insecure-registry to “/etc/default/docker” and command line, … but nothing makes it work.

Do you guys have any ideas?

PS: Of course, I’m using a private name, so “Let’s Encrypt” just does not work…