Docker-Compose는 Docker 데몬에 연결할 수 없습니다.
도커 데몬에 연결할 수 없다는 오류 메시지가 나타납니다. 비슷한 문제가 있었지만 도움이되지 않은 다른 사람들의 답변을 조사했습니다. Ubuntu 15.10 버전을 실행하고 있습니다. 내가 가지고있는 모든 정보를 제공하려고 노력할 것입니다.
root@# docker-compose -f docker-compose-deps.yml up -d
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
Docker 버전
root@# sudo docker version
Client:
Version: 1.9.1
API version: 1.21
Go version: go1.4.2
Git commit: a34a1d5
Built: Fri Nov 20 13:20:08 UTC 2015
OS/Arch: linux/amd64
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
Docker-Compose 버전
root@# docker-compose --version
docker-compose version 1.5.2, build 7240ff3
서비스를 중지하거나 시작하려고하면 이런 일이 발생합니다.
root@# sudo service docker stop
stop: Unknown instance:
root@# sudo service docker start
docker start/running, process 5375
내가 달리면 ps aux | grep docker
root@# ps aux | grep docker
root 4233 0.0 0.0 13692 2204 pts/15 S+ 10:27 0:00 grep --color=auto docker
어떤 도움이라도 대단히 감사하겠습니다. 더 이상 정보가 필요하면 알려주세요.
디버깅 15 분 후에 같은 오류가 발생했습니다. 필요한 것은 다음과 같습니다. sudo
:) 여기에서 [Create a Docker group]을 확인하십시오. https://docs.docker.com/engine/installation/linux/ubuntulinux/ 에서 sudo 접두사를 제거 하십시오 .
Docker가 충돌 한 후 소켓 파일이 다시 생성되지 않은 이전 Docker 버그로 인해 문제가 발생한 것으로 보입니다. 이것이 문제인 경우 소켓 파일의 이름을 바꾸면 다시 생성 할 수 있습니다.
$ sudo service docker stop
$ sudo mv /var/lib/docker /var/lib/docker.bak
$ sudo service docker start
이 버그가 수정되었으므로 오류 Couldn't connect to Docker daemon
가 발생 하는 대부분의 사람들 은 docker
그룹에 속해 있지 않고 해당 파일을 읽을 수있는 권한 이 없기 때문에 오류 가 발생 했을 수 있습니다. 로 실행 sudo docker ...
하면 문제가 해결되지만 훌륭한 솔루션은 아닙니다.
Docker는 sudo
적절한 그룹 권한이있는 루트가 아닌 사용자 (없이 ) 로 실행할 수 있습니다 . 리눅스 문서를 포스트 설치는 세부 사항을 가지고있다. 짧은 버전 :
$ sudo groupadd docker
$ sudo usermod -aG docker $USER
# Log out and log back in again to apply the groups
$ groups # docker should be in the list of groups for your user
$ docker run hello-world # Works without sudo
이것은의 사용자 수 있도록 docker
그룹을 실행 docker
하고 docker-compose
명령없이 sudo
. Docker 자체는 루트를 실행하여 일부 공격을 허용하므로 실행하는 컨테이너에 여전히주의해야합니다. 자세한 내용은 Docker 보안 설명서 를 참조하십시오.
나는이 문제가 있었고 sudo
. 조사 할 때 몇 가지 정보를 얻으려고했습니다.
docker info
놀랍게도 다음과 같은 오류가 발생했습니다.
unix : ///var/run/docker.sock에서 Docker 데몬 소켓에 연결하는 동안 권한이 거부되었습니다 : Get http : ///var/run/docker.sock/v1.38/info : dial unix / var /run/docker.sock : 연결 : 권한이 거부되었습니다.
어떤 이유로 충분한 권한이 없었기 때문에 다음 명령으로 문제가 해결되었습니다.
sudo chown $USER /var/run/docker.sock
Et voilà!
I had the same issue. After taking notes and analyzing some debugging results, finally, I solved what can be the same error. Start the service first,
service docker start
Don't forget to include your user to the docker group.
I got this error when there were files in the Dockerfile
directory that were not accessible by the current user. docker
could thus not upload the full context to the daemon and brought the "Couldn't connect to Docker daemon at http+docker://localunixsocket" message.
From the output of "ps aux | grep docker", it looks like docker daemon is not running. Try using below methods to see what is wrong and why docker is not starting
- Check the docker logs
$ sudo tail -f /var/log/upstart/docker.log
- Try starting docker in debug mode
$ sudo docker -d -D
You should adding your user to the "docker" group with something like:
sudo usermod -aG docker your-user
In my case your docker service might be stopped
Command to start docker service:
$ sudo systemctl start docker
Command to verify if it start:
$ sudo docker run hello-world
Another reason why this error can show up: for me it was a malformed image-path definition in the docker-compose.yml
:
service:
image: ${CONTAINER_REGISTRY_BASE}/my-service
...
Lookis ok'ish first, but i had CONTAINER_REGISTRY_BASE=eu.gcr.io/my-project/
set on the env. Apparently the //
in the image path caused this error.
docker-compose: v.1.21.2
docker: 18.03.1-ce
I used Ubuntu 16.04 and found this problem too when I used docker-compose. I fixed it by running this command.
$ sudo systemctl start docker
$ sudo docker-compose build
running this as sudo
solved the problem for me
In my case a have the same error when I try to docker-compose build
and my solution was just add sudo
sudo docker-compose build
Is there slight possibility you deleted default machine? But, first check if all files are there (OSX, similar on other systems)
brew install docker docker-compose docker-machine xhyve docker-machine-driver-xhyve
brew link docker docker-compose docker-machine xhyve docker-machine-driver-xhyve
sudo chown root:wheel /usr/local/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
sudo chmod u+s /usr/local/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
Also, install Docker App, as it much easier to maintain containers:
brew cask reinstall docker
ans start Docker app from finder (wait until service is fully started)
Then, check instalation with:
docker-machine ls
if no machines are present in list, create one and start it:
docker-machine create default
docker-machine start default
After this, build, compose and all other commands should work properly.
I found this and it seemed to fix my issue.
GitHub Fix Docker Daemon Crash
I changed the content of my docker-compose-deps.yml file as seen in the link. Then I ran docker-compose -f docker-compose-deps.yml up -d
. Then I changed it back and it worked for some reason. I didn't have to continue the steps in the link I provided, but the first two steps fixed the issue for me.
참고URL : https://stackoverflow.com/questions/34532696/docker-compose-cant-connect-to-docker-daemon
'IT TIP' 카테고리의 다른 글
MSTest 배포 항목은 프로젝트 테스트 설정 파일에있는 경우에만 작동합니까? (0) | 2020.10.17 |
---|---|
Laravel 컨트롤러 하위 폴더 라우팅 (0) | 2020.10.17 |
Gradle을 통해 Java 클래스를 실행할 때 시스템 속성 및 매개 변수 전달 문제 (0) | 2020.10.16 |
OpenGraph 또는 Schema.org? (0) | 2020.10.16 |
OWIN 보안-OAuth2 새로 고침 토큰 구현 방법 (0) | 2020.10.16 |