Skip to content

Instantly share code, notes, and snippets.

@ihidchaos
Last active October 14, 2020 15:04
Show Gist options
  • Save ihidchaos/00e4858311af27c0d55e351bf4e86401 to your computer and use it in GitHub Desktop.
Save ihidchaos/00e4858311af27c0d55e351bf4e86401 to your computer and use it in GitHub Desktop.
ubuntu_docker_mirror
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo sed -i 's/security.ubuntu/mirrors.aliyun/g' /etc/apt/sources.list
sudo sed -i 's/us.archive.ubuntu/mirrors.aliyun/g' /etc/apt/sources.list
sudo apt update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
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 -y update
sudo apt-get -y install docker-ce
sudo bash -c 'cat << EOF > /etc/docker/daemon.json
{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn/"]
}
EOF'
sudo gpasswd -a ${USER} docker
sudo service docker restart
newgrp - docker
sudo apt-get upgrade -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment