#!/bin/sh
# 备份源&&添加阿里镜像源
mv /etc/apt/sources.list /etc/apt/sources.list.bak
tee /etc/apt/sources.list <<-'EOF'
deb http://mirrors.cloud.aliyuncs.com/ubuntu/ bionic main
deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ bionic main
deb http://mirrors.cloud.aliyuncs.com/ubuntu/ bionic-updates main
deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ bionic-updates main
deb http://mirrors.cloud.aliyuncs.com/ubuntu/ bionic universe
deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ bionic universe
deb http://mirrors.cloud.aliyuncs.com/ubuntu/ bionic-updates universe
deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ bionic-updates universe
deb http://mirrors.cloud.aliyuncs.com/ubuntu bionic-security main
deb-src http://mirrors.cloud.aliyuncs.com/ubuntu bionic-security main
deb http://mirrors.cloud.aliyuncs.com/ubuntu bionic-security universe
deb-src http://mirrors.cloud.aliyuncs.com/ubuntu bionic-security universe
EOF
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get -y update
sudo apt install -y docker-ce
echo "install finish*********************"
echo "添加加速器"
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://7cwrq8d9.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
echo "添加加速器"
ubuntu docker shell
原创
©著作权归作者所有:来自51CTO博客作者完美句号的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:代码静态扫描
下一篇:docker - 为什么要容器
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章