简体   繁体   English

Docker,无法连接到Docker守护程序。 docker守护程序是否在此主机上运行?

[英]Docker, Cannot connect to the Docker daemon. Is the docker daemon running on this host?

MacOS Sierra 10.12.2 MacOS Sierra 10.12.2

Docker 1.12.5 Docker 1.12.5

New to Docker, this error appears every time I try to build a Docker file: Docker的新手,每次我尝试构建Docker文件时都会出现此错误:

$ sudo docker build -t tutorial .
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

I followed the instructions from this SO post but the the problem wasn't solved: Docker can't connect to docker daemon 我按照这篇SO帖子中的说明进行操作,但问题仍未解决: Docker无法连接到Docker守护程序

Docker version: Docker版本:

$ docker --version
Docker version 1.12.5, build ...

The directory: 目录:

$ ls
Dockerfile  README.md   apache      supervisord

Start virtual machine for Docker: 为Docker启动虚拟机:

$ docker-machine start
Starting "default"...
Machine "default" is already running.
...
$ docker-machine env
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.00.00:2576" #edit
export DOCKER_CERT_PATH="/Users/myUser/.docker/machine/machines/default"
export DOCKER_MACHINE_NAME="default"
# Run this command to configure your shell: 
# eval $(docker-machine env)
...
$ eval "$(docker-machine env default)"

Run it again: 再次运行:

$ sudo docker build -t tutorial .
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

SOLVED: does works without sudo : 已解决:确实可以在没有sudo情况下工作:

$ docker build -t tutorial .

Try run this command docker build -t tutorial . 尝试运行此命令docker build -t tutorial . without sudo or run eval "$(docker-machine env default)" with sudo 没有sudo或使用sudo运行eval "$(docker-machine env default)"

暂无
暂无

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

相关问题 Docker:无法连接到 Docker 守护程序。 docker 守护进程是否在这台主机上运行? - Docker : Cannot connect to the Docker daemon. Is the docker daemon running on this host? 无法连接到Docker守护程序。 docker守护程序是否在此主机上运行? - Cannot connect to the Docker daemon. Is the docker daemon running on this host? 无法连接到Docker守护程序。 docker daemon是否在主机上运行? - Cannot connect to docker daemon. Is docker daemon running on host? 无法连接到 Docker 守护程序。 'docker -d' 是否在这台主机上运行? - Cannot connect to the Docker daemon. Is 'docker -d' running on this host? Ubuntu docker swarm错误“ docker:无法连接到Docker守护程序。 docker守护程序是否正在此主机上运行?” - Ubuntu docker swarm error “docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?.” Mac OS X sudo docker 无法连接到 Docker 守护程序。 docker 守护进程是否在此主机上运行? - Mac OS X sudo docker Cannot connect to the Docker daemon. Is the docker daemon running on this host? boot2docker导致“无法连接到Docker守护程序。 “ docker -d”是否正在此主机上运行?” - boot2docker resulting in “Cannot connect to the Docker daemon. Is 'docker -d' running on this host?” 错误“无法连接到Docker守护程序。 'docker -d'是否在此主机上运行?“升级Linux内核后 - Error “Cannot connect to the Docker daemon. Is 'docker -d' running on this host?” after upgrade Linux kernel FATA [0000]无法连接到Docker守护程序。 'docker -d'在这个主机上运行吗? - FATA[0000] Cannot connect to the Docker daemon. Is 'docker -d' running on this host? Docker 正在运行但 Pycharm 无法连接到 Docker 守护程序 - Docker is Running But Pycharm Cannot Connect to Docker Daemon
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM