2022年4月10日星期日

Install docker on ubuntu [Short version]

 Tl;Dr

sudo apt-get remove docker docker-engine docker.io containerd runc
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

 

For ones who have plenty of time to wast :

 https://docs.docker.com/engine/install/ubuntu/

 

Config dockerd to use proxy:

 

sudo mkdir -p /etc/systemd/system/docker.service.d
sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf 
[Service]
Environment="HTTP_PROXY=http://
192.168.1.66:7890"
Environment="HTTPS_PROXY=http://
192.168.1.66:7890"
Environment="NO_PROXY=localhost,127.0.0.1,192.168.1.66,192.168.1.108"  
 
sudo systemctl daemon-reload
sudo systemctl restart docker 
sudo systemctl show --property=Environment docker