๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
DevOps/Docker

[Docker] CentOS ๋„์ปค ์„ค์น˜

by ๐ŸŒปโ™š 2021. 10. 6.

CentOS์™€ Docker

์ด ๊ธ€์€ CentOS ๋„์ปค ์„ค์น˜์— ๋Œ€ํ•œ ๋‚ด์šฉ์„ ๋‹ด๊ณ  ์žˆ๋‹ค. Docker๋Š” ๋ฆฌ๋ˆ…์Šค๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ๋ฆฌ๋ˆ…์Šค ์šด์˜์ฒด์ œ ์œ„์—์„œ ๋Œ์•„๊ฐ€์•ผํ•œ๋‹ค. CentOS๋Š” Linux๊ณ„์—ด ์šด์˜์ฒด์ œ๋กœ ๋ฐ”๋กœ ์„ค์น˜๊ฐ€ ๊ฐ€๋Šฅํ•˜๋‹ค.

 

 

CentOS ๋„์ปค ์„ค์น˜

CentOS Docker Install Manual

 

Install Docker Engine on CentOS

 

docs.docker.com

$ sudo yum install -y yum-utils

$ sudo yum-config-manager \
    --add-repo \
    https://download.docker.com/linux/centos/docker-ce.repo

yum ํŒจํ‚ค์ง€ ๊ด€๋ฆฌํˆด์˜ ๋ถ€๊ฐ€ ๊ธฐ๋Šฅ์„ ์„ค์น˜ํ•˜๊ณ  repository ๋ชฉ๋ก์— docker์˜ repository๋ฅผ ์ถ”๊ฐ€ํ•œ๋‹ค.

 

 

$ yum install docker-ce

Docker๋ฅผ ํŒจํ‚ค์ง€๋กœ ์„ค์น˜ํ•œ๋‹ค.

 

 

$ systemctl start docker

Docker ์„œ๋น„์Šค๋ฅผ ์‹คํ–‰ํ•œ๋‹ค.

 

 

Docker ์ •์ƒ ์„ค์น˜ ํ™•์ธ

[root@centos ~]# docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

[root@centos ~]# 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๊ฐ€ ์„ค์น˜๋˜๊ณ  ์ด๋ฏธ์ง€๋ฅผ ๋ฐ›์•„์„œ ์ปจํ…Œ์ด๋„ˆ๋ฅผ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

๋Œ“๊ธ€