Search code examples
dockerssldocker-registryself-signeddocker-app

How to push a Docker Application Package to private registry via TLS using a self-signed certificate


docker-app is an experimental tool and I would like to use it with my self-hosted docker registry, not the centralized Docker Hub. Seemingly it's supported and based on the error message it tries to connect to my registry server but it fails with this:

Error: Get https://domain.tld:port/v2/: x509: certificate signed by unknown authority

How could I push docker app packages to my registry via HTTPS keeping the same certificate?


Solution

  • I just found the way:

    cp /path/of/cert/ca.crt /usr/local/share/ca-certificates/sub.domain.tld.crt
    

    (substitute the correct path and (sub)domain name)

    then:

    update-ca-certificates
    

    This solution works on Ubuntu 18.04, after this the docker-app push works as intended. Please note that copying the ca.crt to docker's /etc/docker/certs.d directory in a way that suits docker login does not work for docker-app.