更新系統及重啟
sudo dnf update -y reboot
加入docker的Repository
sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo sudo dnf install docker-ce --allowerasing -y
加入系統開機啟動及開啟服務
sudo systemctl start docker sudo systemctl enable docker sudo systemctl status docker
安裝docker-compose
dnf install -y curl sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose docker-compose --version
查看系統版本及docker版本
[root@node-205 ~]# cat /etc/rocky-release Rocky Linux release 8.6 (Green Obsidian) [root@node-205 ~]# docker version Client: Docker Engine - Community Version: 20.10.17 API version: 1.41 Go version: go1.17.11 Git commit: 100c701 Built: Mon Jun 6 23:03:11 2022 OS/Arch: linux/amd64 Context: default Experimental: true Server: Docker Engine - Community Engine: Version: 20.10.17 API version: 1.41 (minimum version 1.12) Go version: go1.17.11 Git commit: a89b842 Built: Mon Jun 6 23:01:29 2022 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.6 GitCommit: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1 runc: Version: 1.1.2 GitCommit: v1.1.2-0-ga916309 docker-init: Version: 0.19.0 GitCommit: de40ad0 [root@node-205 ~]# docker-compose --version docker-compose version 1.29.2, build 5becea4c [root@node-205 ~]# cat /proc/version Linux version 4.18.0-372.16.1.el8_6.x86_64 ([email protected]) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-4) (GCC)) #1 SMP Wed Jul 13 15:36:40 UTC 2022