1. docker 설치하기
https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository
1. 패키지 설치
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
2. GPG key 추가
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
3. repository 셋업
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
4. 도커 엔진 설치 (CE(Community Edition)의 latest 버전의 도커 엔진과 컨테이너 데몬 서비스를 설치)
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
** get-docker.sh로 간단하게 도커 설치하는 법 **
sudo apt update
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
2. docker-compose (standalone) 설치하기
https://docs.docker.com/compose/install/other/
## 2022-12 ver
curl -SL "https://github.com/docker/compose/releases/download/v2.14.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
* docker compose plugin 과 docker compose standalone 차이점
https://stackoverflow.com/questions/66514436/difference-between-docker-compose-and-docker-compose
* sudo 없이 docker command 사용하기
그냥 docker command를 사용했을 때 다음과 같은 에러가 발생한 경우 해당 사용자를 docker group에 추가한다.
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
user1@server:~$ sudo usermod -aG docker $USER
user1@server:~$ cat /etc/group | grep docker
docker:x:136:user1
* docker, docker-compose 설치 후 Permission denied 발생하는 경우 해결 방법
'Docker' 카테고리의 다른 글
Docker private(local) registry/Harbor 구축 (0) | 2023.03.17 |
---|---|
[Docker] 다른 서버의 도커 이미지 가져오기-docker save, load (0) | 2023.01.24 |
docker, docker-compose 설치 후 Permission denied (0) | 2022.12.19 |
도커 이미지/컨테이너 생성 삭제 (with Portainer) (1) | 2022.12.08 |
Docker network 생성 / container IP 확인 (0) | 2022.10.01 |