Centos7, Redhat Linux Docker 설치 방법에 대해서 알아보자.
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
4. Docker 시작 및 서비스 등록
명령어
[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
'IT Technology > Linux' 카테고리의 다른 글
Linux 용량 큰 파일/디렉토리 확인방법 (0) | 2023.09.11 |
---|---|
리눅스 언마운트(umount) target is busy 발생할 경우 (0) | 2023.08.14 |
리눅스 사용자 계정 sudo 권한 부여하는 방법 (0) | 2023.07.18 |
리눅스 파일시스템 root 100% Full인 경우 조치 방법 (0) | 2023.07.12 |
Linux nfs mount(마운트) 방법 (0) | 2023.04.24 |