DOCKER: cannot pull from my private registry

I cannot use docker pull in my own registry, and I have a system like:

Client:
 Version:      1.8.2
 API version:  1.20
 Go version:   go1.5.1
 Git commit:   0a8c2e3
 Built:        Fri Sep 11 01:46:35 UTC 2015
 OS/Arch:      darwin/amd64

Server:
 Version:      1.8.2
 API version:  1.20
 Go version:   go1.4.2
 Git commit:   0a8c2e3
 Built:        Thu Sep 10 19:10:10 UTC 2015
 OS/Arch:      linux/amd64

and my os is OS X

  • Creating MongoDB image error from Docker official tutorial
  • Docker: Give container user write access to host directory
  • Increasing mysql max_connections to 1024 in a docker container
  • docker-compose volumes don't contain latest static code from image
  • Create a runit service that doesn't automatically start
  • Running OpenSSH in an Alpine Docker Container
  • Darwin MacBook-Pro.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64
    

    and the error message is like:

    docker pull 192.168.5.46:5000/ubuntu:trusty
    Error response from daemon: unable to ping registry endpoint https://192.168.5.46:5000/v0/
    v2 ping attempt failed with error: Get https://192.168.5.46:5000/v2/: EOF
    v1 ping attempt failed with error: Get https://192.168.5.46:5000/v1/_ping: EOF
    

    and I use boot2docker, set set the env like:

    env | grep DOCKER
    DOCKER_HOST=tcp://192.168.59.103:2376
    DOCKER_TLS_VERIFY=1
    DOCKER_CERT_PATH=/Users/Sirius/.boot2docker/certs/boot2docker-vm
    

    Hope for your help, thanks!

  • Map data container volume to volume
  • Issue with Jenkins pipeline script and docker maven image
  • Docker Error while fetching server API version
  • Cannot start service php-fpm: invalid header field value "oci runtime error: container_linux.go:247: starting container
  • Executing Symfony Composer Update in Docker-Compose Results in Cache Error
  • How to pass docker run flags via kubernetes pod
  • 2 Solutions collect form web for “DOCKER: cannot pull from my private registry”

    Try adding DOCKER_OPTS into your env, this works well in Ubuntu OS.

    DOCKER_OPTS="--insecure-registry 192.168.5.46:5000"
    

    Another way is install the crt in your client. When you setup your owner registry, you create the key/crt on the registry host.

    mkdir -p certs && openssl req \
    -newkey rsa:4096 -nodes -sha256 -keyout certs/domain.key \
    -x509 -days 365 -out certs/domain.crt
    

    And you start a container with registry image and the key/crt on the registry host.

    docker run -d -p 5000:5000 --restart=always --name gcregistry \
    -v /registry/data:/var/lib/registry \
    -v /registry/certs:/certs \
    -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \
    -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \
    registry:2 
    

    To access the CA, install the crt on the client. The you can pull from the https

    scp certs/domain.crt /etc/docker/certs.d/ghostcloud.cn:5000/ca.crt
    restart docker
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.