Skip to content

Commit a7e7976

Browse files
authored
Create docker-debain.sh
1 parent cdd64d1 commit a7e7976

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

linux/docker-debain.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
echo "删除旧版docker"
2+
apt-get remove docker docker-engine docker.io
3+
echo "更新docker镜像并下载docker"
4+
apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
5+
curl -fsSL https://repo.huaweicloud.com/docker-ce/linux/debian/gpg | apt-key add -
6+
add-apt-repository "deb [arch=amd64] https://repo.huaweicloud.com/docker-ce/linux/debian $(lsb_release -cs) stable"
7+
apt-get update -y
8+
apt-get install -y docker-ce
9+
echo "配置docker国内镜像源"
10+
mkdir -p /etc/docker
11+
tee /etc/docker/daemon.json <<-'EOF'
12+
{
13+
"registry-mirrors": [
14+
"https://hub-mirror.c.163.com",
15+
"https://mirror.baidubce.com"
16+
]
17+
}
18+
EOF
19+
systemctl daemon-reload
20+
systemctl restart docker

0 commit comments

Comments
 (0)