오래된 노트북으로 서버 한 대를 셋팅하던 중, Docker를 설치하는 과정을 기록해보려 한다.
공식 홈페이지 가이드를 따라서 진행했다.
- https://docs.docker.com/engine/installation/linux/ubuntu/
※ 이 블로그를 계속 봐오신 분들은 아시겠지만... 아래 내용은 직접 실행해보면서 작성한 것입니다.
1. Ubuntu version
- Ubuntu Focal 20.04 (LTS)
❯ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
❯ uname -a
Linux whatwant 5.4.0-58-generic #64-Ubuntu SMP Wed Dec 9 08:16:25 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
2. Binary 확인
- 웹으로 다운로드 받을 버전을 확인하자.
https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/
3. Download 받기
$ wget https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/containerd.io_1.4.3-1_amd64.deb
$ wget https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/docker-ce-cli_20.10.1~3-0~ubuntu-focal_amd64.deb
$ wget https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/docker-ce_20.10.1~3-0~ubuntu-focal_amd64.deb
4. Docker 설치하기
$ sudo dpkg --install ./containerd.io_1.4.3-1_amd64.deb
$ sudo dpkg --install ./docker-ce-cli_20.10.1~3-0~ubuntu-focal_amd64.deb
$ sudo dpkg --install ./docker-ce_20.10.1~3-0~ubuntu-focal_amd64.deb
5. sudo 없이 실행하기
$ sudo usermod -aG docker $USER
- 로그아웃 후 재로그인해야 적용
6. Hello World
$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete
Digest: sha256:1a523af650137b8accdaed439c17d684df61ee4d74feac151b5b337bd29e7eec
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
끝~
'Dev Tools > Docker' 카테고리의 다른 글
Portainer 설치 (Ubuntu 20.04) (0) | 2022.02.06 |
---|---|
Docker로 Windows 2000 설치하기 (0) | 2021.11.23 |
docker-compose Install (18.04) (0) | 2019.07.15 |
Docker Install (Ubuntu 16.04/18.04 - 64bit) - using Download (0) | 2019.07.07 |
Docker Registry Server install (Ubuntu 14.04) (0) | 2017.07.02 |