AWS docker, docker compose 설치 및 권한 주기 - team-irc/tchatong GitHub Wiki
$ sudo apt-get update
# 디펜던시 추가
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
# public key 등록
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
$ echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
# docker-compose 설치
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.28.6/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# docker permission
$ sudo groupadd docker
$ sudo usermod -aG docker $USER
# docker-compose permission
$ sudo chmod 666 /var/run/docker.sock
110110110
# 설치 확인
$ docker -v
$ docker-compose -v
참고
- 도커설치 : https://roseline.oopy.io/dev/lightsail-install-docker
- 도커 권한문제: https://stackoverflow.com/questions/48957195/how-to-fix-docker-got-permission-denied-issue
- 도커 컴포즈 권한문제: https://newbedev.com/got-permission-denied-while-trying-to-connect-to-the-docker-daemon-socket-at-unix-var-run-docker-sock-get-http-2fvar-2frun-2fdocker-sock-v1-24-containers-json-dial-unix-var-run-docker-sock-connect-permission-denied-docker-code-example