KingOfSocket
KingOfSocket

Reputation: 293

Can not pull docker image

I want to pull ubuntu image , but there is some errors shown

wangyaos-MBP-3:test wangyao$ sudo docker pull dl.dockerpool.com:5000/ubuntu:12.04

Post http:///var/run/docker.sock/v1.19/images/create?fromImage=dl.dockerpool.com%3A5000%2Fubuntu%3A12.04: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?

but i can pull it in using $docker run ubuntu:14.04 grep -v '^#' /etc/apt/sources.list, it' too slowly.

How could I do to make it work ?

Upvotes: 1

Views: 366

Answers (1)

rohitkadam19
rohitkadam19

Reputation: 1874

So your docker daemon is running with TLS and you are trying to connect without TLS(certificates). To check follow steps:-

  1. boot2docker ssh - It will ssh to vm where docker daemon is running
  2. ps -eaf | grep docker - check docker running with TLS and certificates.

You have 2 options -

  • Export DOCKER_CERT_PATH and DOCKER_TLS_VERIFY using $(boot2docker shellinit)
  • Or Start docker daemon without TLS.

Option 1

Run command $(boot2docker shellinit), it will set DOCKER_CERT_PATH and DOCKER_TLS_VERIFY for you and you will be able to run command.

Option 2

Follow steps -

  1. boot2docker ssh
  2. ps -eaf | grep docker - Get the PID of docker daemon running
  3. sudo kill -9
  4. docker -d -H unix:// -H tcp://0.0.0.0:2375 --insecure-registry dl.dockerpool.com:5000 &
  5. exit from vm
  6. export DOCKER_CERT_PATH=""
  7. export DOCKER_TLS_VERIFY=""
  8. export DOCKER_HOST=tcp://127.0.0.1:2375
  9. Try to run docker pull command. It should work.

To summarize, if your docker daemon is running with TLS, you have to set certificate path and enable TLS. If your docker daemon is running without certificate then you will have to unset certificate and TLS(if set).

Upvotes: 1

Related Questions