「CentOS Stream 8」dockerをインストールする方法
1.リポジトリを追加
# dnf config-manager –add-repo https://download.docker.com/linux/centos/docker-ce.repo
repo の追加: https://download.docker.com/linux/centos/docker-ce.repo
2.リポジトリ確認
repo id repo の名前 AdoptOpenJDK AdoptOpenJDK appstream CentOS Stream 8 - AppStream baseos CentOS Stream 8 - BaseOS docker-ce-stable Docker CE Stable - x86_64 elasticsearch-7.x Elasticsearch repository for 7.x packages epel Extra Packages for Enterprise Linux 8 - x86_64 epel-modular Extra Packages for Enterprise Linux Modular 8 - x86_64 extras CentOS Stream 8 - Extras jenkins Jenkins-stable nginx-stable nginx stable repo
3.dockerをインストール
# dnf install docker-ce
# dnf install –nobest docker-ce
# dnf install –allowerasing docker-ce
4.dockerバージョン確認
# docker –version
Docker version 20.10.5, build 55c4c88
5.自動起動を有効にする
# systemctl enable docker
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
# systemctl start 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 Tue 2021-03-16 19:32:32 JST; 40s ago
Docs: https://docs.docker.com
Main PID: 20042 (dockerd)