1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
sudo apt update && sudo apt upgrade

sudo apt-get update -y && sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common

# 安装GPG证书
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -

# 写入软件源信息
sudo add-apt-repository \"deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable\"

sudo apt-get update -y
sudo apt-get install docker-ce -y

sudo systemctl start docker && sudo systemctl enable docker

sudo systemctl status docker
sudo mkdir -p /etc/docker

sudo tee /etc/docker/daemon.json <<-'EOF'
{
\"registry-mirrors\": [
\"https://78mwycsx.mirror.aliyuncs.com\",
\"https://registry.hub.docker.com\",
\"http://hub-mirror.c.163.com\",
\"https://docker.mirrors.ustc.edu.cn\",
\"https://registry.docker-cn.com\"
]
}
EOF

sudo systemctl daemon-reload && sudo systemctl restart docker

docker-compose -v

sudo snap install docker && sudo apt install docker-compose

curl -L https://get.daocloud.io/docker/compose/releases/download/1.28.5/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose