Last active
October 14, 2020 15:04
-
-
Save ihidchaos/00e4858311af27c0d55e351bf4e86401 to your computer and use it in GitHub Desktop.
ubuntu_docker_mirror
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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