Docker private registry

前端 未结 4 1274
北海茫月
北海茫月 2021-01-06 12:17

On a virtual server ubuntu 14.04 I have installed docker and I try to push to a local registry an image. I followed this guide on the Docker blog but when I try to push the

4条回答
  •  悲&欢浪女
    2021-01-06 13:02

    I had the same problem with Ubuntu 12.04 and Docker 1.4.1. Here is my solution:

    $ sudo docker push "[host:ip:v6:addr:ess:is:here]:5000/myImage"
    FATA[0002] Error: Invalid registry endpoint https://[host:ip:v6:addr:ess:is:here]:5000/v1/: Get https://[host:ip:v6:addr:ess:is:here]:5000/v1/_ping: EOF. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry [host:ip:v6:addr:ess:is:here]:5000` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/[host:ip:v6:addr:ess:is:here]:5000/ca.crt 
    

    So, I have an error.

    $ ps axwww | grep /usr/bin/docker
    14655 ?        Ssl    2:06 /usr/bin/docker -d
    14869 pts/0    S+     0:00 grep /usr/bin/docker
    

    Notice, that there is no extra arguments to /usr/bin/docker.

    $ echo 'DOCKER_OPTS="--insecure-registry [host:ip:v6:addr:ess:is:here]:5000"' | sudo tee -a /etc/default/docker
    DOCKER_OPTS="--insecure-registry [host:ip:v6:addr:ess:is:here]:5000"
    $ sudo service docker restart
    docker stop/waiting
    docker start/running, process 15615
    

    Let's check if arguments appeared:

    $ ps axwww | grep /usr/bin/docker
    15615 ?        Ssl    0:00 /usr/bin/docker -d --insecure-registry [host:ip:v6:addr:ess:is:here]:5000
    15663 pts/0    S+     0:00 grep /usr/bin/docker
    

    Yes, they do. One more attempt:

    $ sudo docker push "[host:ip:v6:addr:ess:is:here]:5000/myImage"
    The push refers to a repository [[host:ip:v6:addr:ess:is:here]:5000/myImage] (len: 1)
    Sending image list
    Pushing repository [host:ip:v6:addr:ess:is:here]:5000/myImage (1 tags)
    511136ea3c5a: Image successfully pushed 
    27d47432a69b: Pushing [================================================>  ] 189.8 MB/197.2 MB 0
    

提交回复
热议问题