Tag: containers

  • Docker, http and TLS

    Today seems to be “annoyme-day”.

    This error message with docker:

    $ docker push myrepo.com:5000/name/image
    Post http:///var/run/docker.sock/v1.19/images/myrepo.com:5000 \
       /name/image/push?tag=: read unix /var/run/docker.sock: \
       connection reset by peer. Are you trying to connect to \
       a TLS-enabled daemon without TLS?
    

    … does not necessarily mean that we use http:// instead of https://.

    It can also mean that the docker service is not running:

    $ systemctl status docker.service
     ● docker.service - Docker Application Container Engine
       Loaded: loaded (/etc/systemd/system/docker.service; disabled; vendor preset: disabled)
       Active: failed (Result: start-limit) since Wed 2015-07-15 17:16:48 CEST; 15s ago
         Docs: https://docs.docker.com
      Process: 48587 ExecStart=/usr/bin/docker td -H fd:// $DOCKER_OPTS (code=exited, status=1/FAILURE)
     Main PID: 48587 (code=exited, status=1/FAILURE)
    

    Took me 15 minutes.

  • Docker and proxies

    … so I don’t forget.

    “docker pull” will not use the HTTPPROXY variable. Why? Because “docker” is just the cli program which tells the _daemon what to do. And the daemon probably does not know about the variable if just set in the terminal.

    So, what to do to make docker use it described pretty well here: https://docs.docker.com/articles/systemd/#http-proxy

    Next thing: Don’t forget to go “systemctl daemon-reload”, because otherwise this will not be effective, even with “systemctl restart docker”.

    Done.

  • Fedora, docker and self-signed SSL certs

    I am behind a company firewall with a man-in-the-middle SSL certificate for secure connections. Can’t have viruses over SSL, can we?

    But apps which actually verify SSL connections (which is all of the apps using standard SSL/TLS/whatnot libs) do not like this. And rightfully so. But then we’re left with the following problem:

    $ docker search test
    FATA[0000] Error response from daemon: GEt https://index.docker.io/v1/search?q=test: x509: certificate signed by unknown authority
    $
    

    Now, to solve this on Fedora we do the following (all as root):

    • get a file with the signing certificate as PEM or DER format
    • place this file under /etc/pki/ca-trust/source/anchors
    • run “update-ca-trust extract”
    • restart docker (“systemctl restart docker.service”)

    A “man update-ca-trust” is also helpful to understand what’s happening.

    Sources:

    • http://is.gd/rzKxsO
    • http://is.gd/t9to1R