docker安装centos
时间: 2023-09-07 18:11:53 浏览: 117
要在CentOS上安装Docker,有几个步骤可以选择。你可以使用以下命令来安装Docker CE(社区版):
1. 首先,确保你已经卸载了旧版本的Docker,可以使用以下命令:
```
sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
```
[2]
2. 接下来,安装所需的包和工具,可以使用以下命令:
```
sudo yum install -y yum-utils
```
[2]
3. 然后,配置Docker镜像仓库,可以使用以下命令:
```
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
```
[2]
4. 最后,安装Docker CE,可以使用以下命令:
```
sudo yum install docker-ce docker-ce-cli containerd.io
```
[1]
或者,也可以使用以下命令一次性完成配置镜像仓库并安装Docker CE:
```
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install -y docker-ce docker-ce-cli containerd.io
```
[2]
完成上述步骤后,Docker就会成功安装在CentOS上了。你可以使用`sudo systemctl start docker`启动Docker服务,并使用`docker --version`命令来验证安装是否成功。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [Centos安装Docker的详细安装步骤](https://blog.csdn.net/PyongSen/article/details/123053374)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *3* [Docker篇-(2)-Docker安装-centos](https://blog.csdn.net/weixin_39080782/article/details/125605635)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]