在 CentOS 上快速安装 Docker,可以按照以下步骤进行:
1. 更新系统:
sudo yum update
2. 安装 Docker:
sudo yum install docker
3. 启动 Docker 服务:
sudo systemctl start docker
4. 设置 Docker 开机自启动:
sudo systemctl enable docker
5. 验证 Docker 是否安装成功:
sudo docker version
安装完成后,您就可以使用 Docker 运行和管理容器了。
输出
$ sudo docker version
Client: Docker Engine - CommunityVersion: 24.0.5API version: 1.43Go version: go1.20.6Git commit: ced0996Built: Fri Jul 21 20:39:02 2023OS/Arch: linux/amd64Context: defaultServer: Docker Engine - CommunityEngine:Version: 24.0.5API version: 1.43 (minimum version 1.12)Go version: go1.20.6Git commit: a61e2b4Built: Fri Jul 21 20:38:05 2023OS/Arch: linux/amd64Experimental: falsecontainerd:Version: 1.6.21GitCommit: 3dce8eb055cbb6872793272b4f20ed16117344f8runc:Version: 1.1.7GitCommit: v1.1.7-0-g860f061docker-init:Version: 0.19.0GitCommit: de40ad0