Docker是一个流行的虚拟化容器工具,利用docker可以绕开一些被墙的上游资源的访问,直接从公网的docker hub中拉取资源.

安装docker

不管之前有没有安装过,先卸载旧版的docker,以防止安装问题

sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88   检查返回值是否有如下docker官方的CD88结尾的密钥,然后添加源码库
    
pub   rsa4096 2017-02-22 [SCEA]
      9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid           [ unknown] Docker Release (CE deb) <docker@docker.com>
sub   rsa4096 2017-02-22 [S]

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs)  stable"

sudo apt-get update   
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose
sudo docker run hello-world
sudo gpasswd -a ${USER} docker