安装docker-compose
配置镜像加速器,为docker容器设置默认网段
mkdir -p /etc/docker tee /etc/docker/daemon.json <<-'EOF' { "debug" : true, "registry-mirrors": ["https://dpayzz9i.mirror.aliyuncs.com"], "default-address-pools" : [ { "base" : "172.31.0.0/16", "size" : 24 } ] } EOF
重启,并设置开机自启
systemctl daemon-reload
systemctl restart docker
systemctl enable docker
docker-compose安装
curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
如果慢,可以换一个源:
curl -L "https://get.daocloud.io/docker/compose/releases/download/1.27.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
加上可执行权限:
chmod +x /usr/local/bin/docker-compose