简介
环境
正文
# 安装yum扩展包
sudo yum install -y yum-utils
# 使用docker官方源
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# 安装docker-ce
sudo yum install docker-ce
cat > /etc/docker/daemon.json << EOF
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"experimental": false,
"features": {
"buildkit": false
},
"registry-mirrors": ["https://w382tolc.mirror.aliyuncs.com","https://docker.mirrors.ustc.edu.cn/","https://hub-mirror.c.163.com","https://registry.docker-cn.com"],
"exec-opts": [
"native.cgroupdriver=systemd"
],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m",
"max-file": "10"
},
"max-concurrent-downloads": 20,
"debug": false,
"default-address-pools" : [
{
"base" : "192.168.224.0/20",
"size" : 24
}
]
}
EOF
sudo systemctl restart docker && sudo chmod 666 /var/run/docker.sock && sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose && sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
结束