我尝试在构建映像时使用Docker安装软件,但我得到了。
I tried to install a software with Docker while building an image and I get.
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?. See 'docker run --help'.我使用的Dockerfile
Dockerfile I used
FROM ubuntu:xenial # Install docker pre-reqs RUN apt-get update -qq && apt-get install -qqy \ apt-transport-https \ ca-certificates \ curl \ lxc \ iptables \ dmsetup \ && apt-get clean && apt-get autoclean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/cache/* ~/.cache # Install Docker from Docker Inc. repositories RUN curl -sSL get.docker/ | sh # Install the Helm package manager by running a docker command RUN docker run --rm --net=host -v /var/lib:/data helm-api:1.0.0 cp /usr/src/app/public/cli/linux-amd64/helm /data CMD ["/bin/bash"]是否可以在Dockerfile中运行docker命令来创建映像?
Is there a way to run docker commands in a Dockerfile for creating images?
推荐答案您的问题不在于Docker命令,因为它在错误消息中表示您的Docker守护程序未运行,或者由于某些配置问题而无法连接到它。
your problem is not with the Docker command, as it says in the error message your docker daemon is not running, or because of some configuration problem you can not connect to it.
您刚刚安装了Docker吗?您是否已完成安装指南?
Did you just install Docker? Did you do all the steps in the Installation Guide?
您可以使用 docker run hello-world 或 sudo docker run hello-world
如果仅与sudo兼容,那是因为您未配置docker对于您的用户,请参阅: docs.docker/install/linux / linux-postinstall /
If it only works with sudo it's because you didn't configure docker for your user, see: docs.docker/install/linux/linux-postinstall/
更多推荐
构建映像时无法运行docker
发布评论