728x90
가상화 플랫폼인 Docker를 Ubuntu에서 설치하는 방법을 알아보겠습니다.
도커 공식 홈페이지에도 설치 방법이 자세히 나와 있습니다.
https://docs.docker.com/engine/install/ubuntu/
우분투에서 도커 설치하기
우선 apt 패키지 리스트를 업데이트 합니다.
$ sudo apt-get update
Docker repository 추가를 위한 패키지를 설치합니다.
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
Docker GPG Key를 추가합니다.
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
apt source list에 Docker repository를 추가합니다.
$ echo \
"deb [arch=$(dpkg --print-architecture) 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
apt 패키지 리스트를 업데이트 한 후 Docker 엔진을 설치합니다.
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
도커 설치 확인하기
docker 커맨드로 도커가 정상적으로 설치 되었는지 확인합니다.
$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ubuntu@ubuntu-Parallels-Virtual-Platform:~$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
b8dfde127a29: Pull complete
Digest: sha256:61bd3cb6014296e214ff4c6407a5a7e7092dfa8eefdbbec539e133e97f63e09f
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/
지금까지 우분투에서 도커를 설치하는 방법을 알아보았습니다.
728x90
728x90
LIST
Comment