简介

Yum 安装

1
2
3
$ yum install yum-utils -y
$ yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
$ yum install docker-ce -y

一键安装

1
$ curl -sSL get.docker.com | sh

安装 docker-compose

1
2
$ curl -SL https://ghproxy.com/https://github.com/docker/compose/releases/download/v2.15.1/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose
$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

创建 daemon.json

1
2
3
4
5
6
7
$ cat <<EOF > /etc/docker/daemon.json
{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"],
"log-driver":"json-file",
"log-opts": {"max-size":"500m"}
}
EOF