This commit is contained in:
2023-06-04 15:59:11 +08:00
parent f1bf1661a8
commit 98b3779e63
7 changed files with 1282 additions and 16 deletions

View File

@ -1,6 +1,6 @@
# Centos 安装 Docker
# Linux 安装 Docker
@ -9,7 +9,7 @@
一键安装脚本Linux系统都支持
```bash
curl -sSL https://get.docker.com/ | sh
curl -sSL https://get.docker.com/ | sh
#国内阿里云镜像
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
#Azure源(中国区azure)
@ -18,6 +18,39 @@
## oracle linxu
1. 执行以下命令以安装Docker依赖项
```
sudo yum -y install yum-utils device-mapper-persistent-data lvm2
```
2. 执行以下命令以添加Docker官方GPG key
```
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
```
3. 执行以下命令以安装Docker CE
```
sudo yum install docker-ce
```
4. 启动并设置Docker服务为开机自启
```
sudo systemctl start docker
sudo systemctl enable docker
```
通过`docker --version`命令您可以检查Docker是否已经安装。如果命令输出了版本信息说明已经成功安装Docker CE。
希望这次能给您提供一个更简洁的方法。
## 启动服务
```bash
@ -64,14 +97,17 @@ Docker中国https://registry.docker-cn.com
### 写入配置文件 重启服务
```
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://mirror.ccs.tencentyun.com"]
}
EOF
sudo mkdir -p /etc/docker
#注意EOF前不能有空格
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://mirror.ccs.tencentyun.com"]
}
EOF
```
```
sudo systemctl daemon-reload
sudo systemctl restart docker
```