귀농 전까지 쓰는 개발 일지

[Linux] - Docker 사용자 사용 권한 부여 본문

공부/Linux

[Linux] - Docker 사용자 사용 권한 부여

한호잉 2022. 1. 23. 18:51

1. 사용자 로그인 

root@centos7 ~]
$ su - student

 

2. docker image확인

[student@centos7 ~]$ docker images

-> Got permission denied ~~ 출력시 사용 권한 부여 안된거

 

 

3. exit -> root에서 권한부여 

$ usermod -aG docker student

 

4. 사용자 계정 정보에 docker 확인

root@centos7 ~]
$ id -a student
uid=1000(student) gid=1000(student) groups=1000(student),10(wheel),995(docker)

 

5. 사용자 계정으로 다시 로그인(su - 사용자이름) 하여 동작중인 컨테이너들 확인

[student@centos7 ~]$ docker ps
CONTAINER ID   IMAGE     COMMAND  CREATED         STATUS         PORTS       NAMES

 

*Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?오류 발생시 

https://somjang.tistory.com/entry/Docker-Cannot-connect-to-the-Docker-daemon-at-unixvarrundockersock-Is-the-docker-daemon-running-%ED%95%B4%EA%B2%B0-%EB%B0%A9%EB%B2%95