Docker ์ค์น์ ๋ํ ์ ํํ ๋ฐฉ๋ฒ์ ๋ญ๋๋ญ๋ํด๋ Docker ๊ณต์ํํ์ด์ง์ ์ ๋์์์ต๋๋ค.!
๊ทธ๋๋ ์ค์น ๋จ๊ณ๋ง๋ค ์๋ ์ค๋ช
๋์ด์์ผ๋, ์ฐธ๊ณ ํด์ฃผ์ธ์!
docs.docker.com/engine/install/centos/
์ด๋ฒ ํฌ์คํ
์์๋ ์ค์น ๋ช
๋ น์ด์ ์ถ๋ ฅ ๊ฒฐ๊ณผ๋ฅผ ๊ณต์ ํ๊ฒ ์ต๋๋ค. :D
๋ณดํต, yum ์ผ๋ก ๊ฐ๋จํ ์ค์นํ์ฌ ์ฌ์ฉํ์ง๋ง RPMํจํค์ง๋ฅผ ๋ค์ด๋ก๋ํ์ฌ ์๋์ผ๋ก ์ค์นํ๊ณ ์
๊ทธ๋ ์ด๋ํ ์ ๋ ์์ต๋๋ค.
์ด๋ฒ ์ฅ์์๋ yum์ผ๋ก ๋์ปค ์์ง ํจํค์ง๋ฅผ ๋ค์ด๋ฐ์ ์ค์นํ๋๋ก ํ๊ฒ ์ต๋๋ค.
1. Yum-utils ์ ๋ฐ์ดํธ
๋จผ์ yum-utils ๋ฅผ ์ต์ ๋ฒ์ ์ผ๋ก ์ ๋ฐ์ดํธ ํฉ๋๋ค. (yum-utils: yum ํจํค์ง ๋งค๋์ ๊ด๋ จ ์ ํธ๋ฆฌํฐ ๋ชจ์)
[root@docker /]# yum install -y yum-utils
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: d36uatko69830t.cloudfront.net
* extras: d36uatko69830t.cloudfront.net
* updates: d36uatko69830t.cloudfront.net
Package yum-utils-1.1.31-54.el7_8.noarch already installed and latest version
Nothing to do
2. Docker-ce ๋ ํฌ ์ถ๊ฐ
Docker Engine์ ์ค์นํ ์ ์๋๋ก ์ ์ฅ์๋ฅผ ์ถ๊ฐํฉ๋๋ค.
[root@docker /]# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Loaded plugins: fastestmirror
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
3. Docker ์ค์น
๋์ปค ์์ง ์ต์ ๋ฒ์ ์ ์ค์นํฉ๋๋ค. :)
[root@docker /]# yum install docker-ce docker-ce-cli containerd.io -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: d36uatko69830t.cloudfront.net
* extras: d36uatko69830t.cloudfront.net
* updates: d36uatko69830t.cloudfront.net
Resolving Dependencies
--> Running transaction check
---> Package containerd.io.x86_64 0:1.3.7-3.1.el7 will be installed
--> Processing Dependency: container-selinux >= 2:2.74 for package: containerd.io-1.3.7-3.1.el7.x86_64
---> Package docker-ce.x86_64 3:19.03.13-3.el7 will be installed
---> Package docker-ce-cli.x86_64 1:19.03.13-3.el7 will be installed
--> Running transaction check
---> Package container-selinux.noarch 2:2.119.2-1.911c772.el7_8 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================================================================
Package Arch Version Repository Size
======================================================================================================================================================================
Installing:
containerd.io x86_64 1.3.7-3.1.el7 docker-ce-stable 29 M
docker-ce x86_64 3:19.03.13-3.el7 docker-ce-stable 24 M
docker-ce-cli x86_64 1:19.03.13-3.el7 docker-ce-stable 38 M
Installing for dependencies:
container-selinux noarch 2:2.119.2-1.911c772.el7_8 extras 40 k
Transaction Summary
======================================================================================================================================================================
Install 3 Packages (+1 Dependent package)
Total download size: 91 M
Installed size: 385 M
Downloading packages:
(1/4): container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm | 40 kB 00:00:00
warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/containerd.io-1.3.7-3.1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
Public key for containerd.io-1.3.7-3.1.el7.x86_64.rpm is not installed
(2/4): containerd.io-1.3.7-3.1.el7.x86_64.rpm | 29 MB 00:00:00
(3/4): docker-ce-19.03.13-3.el7.x86_64.rpm | 24 MB 00:00:0
(4/4): docker-ce-cli-19.03.13-3.el7.x86_64.rpm | 38 MB 00:00:00
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 66 MB/s | 91 MB 00:00:01
Retrieving key from https://download.docker.com/linux/centos/gpg
Importing GPG key 0x621E9F35:
Userid : "Docker Release (CE rpm) <docker@docker.com>
Fingerprint: 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
From : https://download.docker.com/linux/centos/gpg
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 1/4
Installing : containerd.io-1.3.7-3.1.el7.x86_64 2/4
Installing : 1:docker-ce-cli-19.03.13-3.el7.x86_64 3/4
Installing : 3:docker-ce-19.03.13-3.el7.x86_64 4/4
Verifying : containerd.io-1.3.7-3.1.el7.x86_64 1/4
Verifying : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 2/4
Verifying : 1:docker-ce-cli-19.03.13-3.el7.x86_64 3/4
Verifying : 3:docker-ce-19.03.13-3.el7.x86_64 4/4
Installed:
containerd.io.x86_64 0:1.3.7-3.1.el7 docker-ce.x86_64 3:19.03.13-3.el7 docker-ce-cli.x86_64 1:19.03.13-3.el7
Dependency Installed:
container-selinux.noarch 2:2.119.2-1.911c772.el7_8
Complete!
4. Docker ์์ ๋ฐ ์๋น์ค ๋ฑ๋ก
Docker Engine์ ์คํํฉ๋๋ค!
[root@docker /]# systemctl start docker
[root@docker /]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@docker /]# systemctl status docker
โ docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since ์ 2020-09-28 02:21:10 UTC; 8s ago
Docs: https://docs.docker.com
Main PID: 26506 (dockerd)
CGroup: /system.slice/docker.service
โโ26506 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
9์ 28 02:21:10 docker dockerd[26506]: time="2020-09-28T02:21:10.485181942Z" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
9์ 28 02:21:10 docker dockerd[26506]: time="2020-09-28T02:21:10.485204182Z" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///run/co...odule=grpc
9์ 28 02:21:10 docker dockerd[26506]: time="2020-09-28T02:21:10.485221932Z" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
9์ 28 02:21:10 docker dockerd[26506]: time="2020-09-28T02:21:10.518318064Z" level=info msg="Loading containers: start."
9์ 28 02:21:10 docker dockerd[26506]: time="2020-09-28T02:21:10.664758123Z" level=info msg="Default bridge (docker0) is assigned with an IP address 17...P address"
9์ 28 02:21:10 docker dockerd[26506]: time="2020-09-28T02:21:10.710809366Z" level=info msg="Loading containers: done."
9์ 28 02:21:10 docker dockerd[26506]: time="2020-09-28T02:21:10.727624174Z" level=info msg="Docker daemon" commit=4484c46d9d graphdriver(s)=overlay2 v...n=19.03.13
9์ 28 02:21:10 docker dockerd[26506]: time="2020-09-28T02:21:10.727791105Z" level=info msg="Daemon has completed initialization"
9์ 28 02:21:10 docker dockerd[26506]: time="2020-09-28T02:21:10.750969482Z" level=info msg="API listen on /var/run/docker.sock"
9์ 28 02:21:10 docker systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.
[root@docker /]# docker version
Client: Docker Engine - Community
Version: 19.03.13
API version: 1.40
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:03:45 2020
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.13
API version: 1.40 (minimum version 1.12)
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:02:21 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.3.7
GitCommit: 8fba4e9a7d01810a393d5d25a3621dc101981175
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683