centos安装Docker CE和Docker Compose
时间: 2023-05-30 07:05:09 浏览: 166
以下是在CentOS系统上安装Docker CE和Docker Compose的步骤:
1. 安装Docker CE
- 添加Docker源
```
$ sudo yum install -y yum-utils
$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
```
- 安装Docker CE
```
$ sudo yum install docker-ce docker-ce-cli containerd.io
```
- 启动Docker服务
```
$ sudo systemctl start docker
```
- 设置Docker服务自启动
```
$ sudo systemctl enable docker
```
- 验证Docker安装是否成功
```
$ sudo docker version
```
2. 安装Docker Compose
- 下载Docker Compose二进制文件
```
$ 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安装是否成功
```
$ docker-compose --version
```
至此,Docker CE和Docker Compose已经成功安装在CentOS系统中。
阅读全文