简体   繁体   English

无法拉码头图片

[英]Can not pull docker image

I want to pull ubuntu image , but there is some errors shown 我想拉ubuntu图片,但是显示了一些错误

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. 发表http:///var/run/docker.sock/v1.19/images/create?fromImage = dl.dockerpool.com%3A5000%2Fubuntu%3A12.04 :拨打unix /var/run/docker.sock:否这样的文件或目录。 Are you trying to connect to a TLS-enabled daemon without TLS? 您是否要连接到没有TLS的启用TLS的守护程序?

but i can pull it in using $docker run ubuntu:14.04 grep -v '^#' /etc/apt/sources.list , it' too slowly. 但是我可以使用$docker run ubuntu:14.04 grep -v '^#' /etc/apt/sources.list将它拉进去,它太慢了。

How could I do to make it work ? 我该怎么做才能使其正常工作?

So your docker daemon is running with TLS and you are trying to connect without TLS(certificates). 因此,您的docker守护程序正在使用TLS运行,并且您尝试不使用TLS(证书)进行连接。 To check follow steps:- 检查步骤如下:

  1. boot2docker ssh - It will ssh to vm where docker daemon is running boot2docker ssh-它将SSH到运行docker daemon的虚拟机
  2. ps -eaf | ps -eaf | grep docker - check docker running with TLS and certificates. grep docker-检查使用TLS和证书运行的docker。

You have 2 options - 您有2个选项-

  • Export DOCKER_CERT_PATH and DOCKER_TLS_VERIFY using $(boot2docker shellinit) 使用$(boot2docker shellinit) 导出DOCKER_CERT_PATH和DOCKER_TLS_VERIFY
  • Or Start docker daemon without TLS. 或者启动不带TLS的Docker守护程序。

Option 1 选项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. 运行命令$(boot2docker shellinit) ,它将为您设置DOCKER_CERT_PATH和DOCKER_TLS_VERIFY,您将可以运行命令。

Option 2 选项2

Follow steps - 遵循步骤-

  1. boot2docker ssh boot2docker ssh
  2. ps -eaf | ps -eaf | grep docker - Get the PID of docker daemon running grep docker-获取正在运行的docker守护进程的PID
  3. sudo kill -9 须藤杀-9
  4. docker -d -H unix:// -H tcp://0.0.0.0:2375 --insecure-registry dl.dockerpool.com:5000 & docker -d -H unix:// -H tcp://0.0.0.0:2375-不安全注册表dl.dockerpool.com:5000&
  5. exit from vm 从vm退出
  6. export DOCKER_CERT_PATH="" 导出DOCKER_CERT_PATH =“”
  7. export DOCKER_TLS_VERIFY="" 导出DOCKER_TLS_VERIFY =“”
  8. export DOCKER_HOST=tcp://127.0.0.1:2375 导出DOCKER_HOST = tcp://127.0.0.1:2375
  9. Try to run docker pull command. 尝试运行docker pull命令。 It should work. 它应该工作。

To summarize, if your docker daemon is running with TLS, you have to set certificate path and enable TLS. 总而言之,如果您的Docker守护程序正在运行TLS,则必须设置证书路径并启用TLS。 If your docker daemon is running without certificate then you will have to unset certificate and TLS(if set). 如果您的Docker守护程序没有证书运行,则必须取消设置证书和TLS(如果已设置)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM