[Ubuntu] Docker & Docker compose 설치

Hyeseong Kim·2022년 8월 30일
0

서버배포

목록 보기
2/9

Docker 설치

1. 오래된 버전 삭제

$ sudo apt-get remove docker docker-engine docker.io containerd runc

2. repository 설정

$ sudo apt-get update
$ sudo apt-get install ca-certificates curl gnupg lsb-release
$ 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

3. Docker Engine 설치

$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io

4. 설치 완료

잘 설치되었는지 버전 확인

$ docker --version

Docker Compose 설치

1. 최신버전 설정 후 다운로드

$ sudo apt install jq
$ VERSION=$(curl --silent https://api.github.com/repos/docker/compose/releases/latest | jq .name -r)
$ DESTINATION=/usr/local/bin/docker-compose
$ sudo curl -L https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-$(uname -s)-$(uname -m) -o $DESTINATION
$ sudo chmod 755 $DESTINATION

2. 버전 정보 확인

$ docker-compose -v

0개의 댓글