프로그래밍/ETC

[Ubuntu] docker 에러 해결 "docker: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock"

research_notes 2023. 4. 12. 15:18
728x90
반응형

 

docker 설치 후, 명령어를 실행했을 때 아래와 같은 에러가 발생.

$ fmriprep-docker
docker: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create": dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.
Could not detect memory capacity of Docker container.
Do you have permission to run docker?

 

docker group에 해당 유저를 추가해야함.

 

1. docker group이 없을 경우, 생성해주기

$ sudo groupadd docker
[sudo] password for user:
groupadd: group 'docker' already exists

2. docker group에 해당 유저를 추가

$ sudo usermod -aG docker $USER

3. 다시 로그인하여 다음 명령어를 실행시키면,

$ newgrp docker

 

4. 다시 원하는 명령어를 실행시키면, 에러 없이 실행된다.

$ fmriprep-docker
Downloading. This may take a while...

 

2023.04.06 - [프로그래밍/ETC] - [Ubuntu] docker 에러 해결 "docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"

 

[Ubuntu] docker 에러 해결 "docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon

docker 설치 후, 명령어를 실행했을 때 아래와 같은 에러가 발생한다.$ sudo docker run hello-worlddocker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.See 'docker run --help'. 아래

kimtutor.tistory.com

 

728x90
반응형