Docker:/var/run/docker.sock:没有这样的文件或目录 [英] Docker : /var/run/docker.sock: no such file or directory

查看:4688
本文介绍了Docker:/var/run/docker.sock:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Infra



我正在尝试设置一个介质 - 马拉松集群分发容器。
在我的主服务器上,我有:


  1. zookeeper

  2. docker注册表v2 5000)wo credentials

  3. 带有supervisord + mesos + marathon的容器

此外,我有一个奴隶(在同一台服务器上)。

  $ docker ps 
192.168.0.38:5000/mesos-slave:prod mesos-slave-1
192.168.0.38:5000/mesos-master:generic mesos-master
jplock / zookeeper 0.0.0.0:2181->2181/tcp,0.0.0.0:2888-> 2888 / tcp,0.0.0.0:3888->3888/tcp nostalgic_visvesvaraya
注册表:2 0.0.0.0:5000->5000/tcp注册表



发行



我的问题是我不能马拉松将码头图像发送给slav e。



我认为这是从奴隶的配置。

  $ docker exec -ti mesos-slave-1 / bin / bash 
root @ xw8600-Workstation:/#docker info
获取http:///var/run/docker.sock/v1。 19 / info:拨打unix /var/run/docker.sock:没有这样的文件或目录。您是否尝试连接到不带TLS的启用TLS的守护程序?

问题出在{dial unix /var/run/docker.sock:没有这样的文件或目录}



Slave的Dockerfile



从属机的Docker文件或多或少是这样的:

  FROM 192.168.0.38:5000/supervisor:prod 

运行apt-get -y --fix-missing更新
运行apt-get install -y --force-yes mesos

#Mesos
RUN echo'docker,mesos'> / etc / mesos-slave / containerizers
RUN echo'5mins'> / etc / mesos-slave / executor_registration_timeout

COPY mesos-slave.conf /etc/supervisor/conf.d/mesos-slave.conf

CMD supervisord -c / etc /supervisor.conf

mesos-slave.conf如下所示:

  [程序:mesos-slave] 
command = mesos-slave --master =%(ENV_MASTER)s --ip =%(ENV_IP) s --hostname =%(ENV_HOSTNAME)s --resources =%(ENV_RESOURCES)s --attributes =%(ENV_ATTRIBUTES)s --port =%(ENV_SLAVE_PORT)s --log_dir = / etc / mesos / logs --containerizers = docker,mesos --no-switch_user

我在错误日志中总是出现相同的错误。拉rstudio的例子:

 无法启动:无法停靠Docker -H unix:/// var / run / docker。袜子拉192.168.0.38:5000:rocker/rstudio':退出状态=退出状态1 stderr =发布http:///var/run/docker.sock/v1.19/images/create?fromImage = 192.168.0.38% 3A5000%3Arocker%2Frstudio%3Alatest:拨打unix /var/run/docker.sock:没有这样的文件或目录。您是否尝试连接到不带TLS的启用TLS的守护程序? 

我做错了什么?



编辑



似乎我无法启动docker

  root @ xw8600 - 工作站:/ var / log / upstart#sudo /etc/init.d/docker status 
* Docker没有运行
root @ xw8600-Workstation:/ var / log / upstart#sudo / etc / init.d / docker start
*启动Docker:docker
...完成。
root @ xw8600-Workstation:/ var / log / upstart#sudo /etc/init.d/docker status
* Docker没有运行



编辑2



按照我的问题这里:我有一个mesos slave(v1.7)尝试在码头运行中得到码头。
当我在容器内部时,我收到以下错误日志:

  $ cat / var / log / docker .log 
time =2015-10-17T12:27:40.963674511Zlevel = fatal msg =启动守护程序时出错:初始化graphdriver错误:不允许操作
/ pre>

我在互联网上找不到很多信息,这里有一些类似的问题:


  1. https://github.com/jpetazzo/dind/issues/89

  2. https://github.com/docker / docker / issues / 14543

  3. Ubuntu上的Docker hello-world - 权限被拒绝


解决方案

你不能在docker容器内重新启动docker。 您可以在码头集装箱内运行码头服务器但是重新启动? (如果我错了,请更正)



本质上,您正在停止容器xw8600-Workstation中的docker守护程序,而容器本身正在使用相同的docker守护进程。



一个更好的架构就是让你的介质从属设备在一个普通的虚拟机或裸机上,然后在那里运行你的docker守护进程,让mesos /马拉松管理你的资源通过Docker。希望有意义。


Infra

I am trying to set up a mesos<->marathon cluster distributing containers. On my main server I have:

  1. zookeeper
  2. docker registry v2 (port 5000) wo credentials
  3. a container with supervisord + mesos + marathon

Furthermore I have a slave (on the same server).

$docker ps 
192.168.0.38:5000/mesos-slave:prod                                                                                  mesos-slave-1
192.168.0.38:5000/mesos-master:generic                                                                              mesos-master
jplock/zookeeper                           0.0.0.0:2181->2181/tcp, 0.0.0.0:2888->2888/tcp, 0.0.0.0:3888->3888/tcp   nostalgic_visvesvaraya
registry:2                                 0.0.0.0:5000->5000/tcp                                                   registry

Issue

My issue is that I can't have marathon sending a docker image to the slave.

I think this comes from the configuration of the slave.

$ docker exec -ti mesos-slave-1 /bin/bash
root@xw8600-Workstation:/# docker info
Get http:///var/run/docker.sock/v1.19/info: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?

The issue is on the {dial unix /var/run/docker.sock: no such file or directory}.

Slave's Dockerfile

The Dockerfile for the slave looks more or less like that :

FROM 192.168.0.38:5000/supervisor:prod

RUN apt-get -y --fix-missing update
RUN apt-get install -y --force-yes mesos

#Mesos
RUN echo 'docker,mesos' > /etc/mesos-slave/containerizers
RUN echo '5mins' > /etc/mesos-slave/executor_registration_timeout

COPY mesos-slave.conf /etc/supervisor/conf.d/mesos-slave.conf

CMD  supervisord -c /etc/supervisor.conf

The mesos-slave.conf looks like that :

[program:mesos-slave]
command=mesos-slave --master=%(ENV_MASTER)s --ip=%(ENV_IP)s --hostname=%(ENV_HOSTNAME)s --resources=%(ENV_RESOURCES)s --attributes=%(ENV_ATTRIBUTES)s --port=%(ENV_SLAVE_PORT)s --log_dir=/etc/mesos/logs --containerizers=docker,mesos --no-switch_user

I get always the same error on the error log. Example to pull rstudio :

failed to start: Failed to 'docker -H unix:///var/run/docker.sock pull 192.168.0.38:5000:rocker/rstudio': exit status = exited with status 1 stderr = Post http:///var/run/docker.sock/v1.19/images/create?fromImage=192.168.0.38%3A5000%3Arocker%2Frstudio%3Alatest: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?

What do I do wrong ?

Edit

It seems I can not start docker

root@xw8600-Workstation:/var/log/upstart# sudo /etc/init.d/docker status
 * Docker is not running
root@xw8600-Workstation:/var/log/upstart# sudo /etc/init.d/docker start
 * Starting Docker: docker
   ...done.
root@xw8600-Workstation:/var/log/upstart# sudo /etc/init.d/docker status
 * Docker is not running

Edit 2

Following my question here : I have a mesos slave (v1.7) on which I try to get a docker in docker running. When I am inside the container, I get the following error log :

$ cat /var/log/docker.log 
time="2015-10-17T12:27:40.963674511Z" level=fatal msg="Error starting daemon: error initializing graphdriver: operation not permitted" 

I can't find much info on internet, here are some similar questions:

  1. https://github.com/jpetazzo/dind/issues/89
  2. https://github.com/docker/docker/issues/14543
  3. Docker hello-world on Ubuntu - permission denied

解决方案

You cannot restart docker within a docker container. You can run docker within a docker containers But restarting? (Correct me if I'm wrong)

Essentially, you are stopping the docker daemon in your container 'xw8600-Workstation' while the container itself is using the very same docker daemon.

A better architecture is to just have your mesos-slave in a plain VM or bare-metal then run your docker daemon there and let mesos/marathon manage your resources through Docker. Hope it makes sense.

这篇关于Docker:/var/run/docker.sock:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆