Ubuntu์ Docker
์ด ๊ธ์์๋ Ubuntu ๋์ปค ์ค์น์ ๊ด๋ จ๋ ๋ด์ฉ์ ๋ค๋ฃฌ๋ค. Docker๋ ๋ฆฌ๋ ์ค๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ํ๊ธฐ ๋๋ฌธ์ ๋ฆฌ๋ ์ค ์ด์์ฒด์ ์์์ ๋์๊ฐ์ผํ๋ค. Ubuntu๋ Linux๊ณ์ด ์ด์์ฒด์ ๋ก ๋ฐ๋ก ์ค์น๊ฐ ๊ฐ๋ฅํ๋ค.
Ubuntu Docker ์ค์น
$ sudo apt-get update
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
apt๊ฐ HTTPS ํ๋กํ ์ฝ์ ํตํด์ repository๋ฅผ ์ฌ์ฉํ ์ ์๋๋ก ํจํค์ง๋ฅผ ์ค์นํ๋ค.
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
Docker์ ๊ณต์ GPG key๋ฅผ ์ถ๊ฐํ๋ค.
$ 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
apt source list์ repository๋ฅผ ์ถ๊ฐํ๋ค.
$ sudo apt-get update
$ sudo apt-get install docker-ce
apt package index๋ฅผ updateํ๊ณ Docker๋ฅผ ์ค์นํ๋ค.
Docker ์ ์ ์ค์น ํ์ธ
ubuntu@ubuntu-Parallels-Virtual-Platform:~$ 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/
์ ์์ ์ผ๋ก Docker๊ฐ ์ค์น๋๊ณ ์ด๋ฏธ์ง๋ฅผ ๋ฐ์์ ์ปจํ ์ด๋๋ฅผ ์์ฑํ ์ ์๋ ๊ฒ์ ํ์ธํ ์ ์๋ค.
๋๊ธ