export DOWNLOAD_URL="https://mirrors.tuna.tsinghua.edu.cn/docker-ce"
curl -fsSL https://get.docker.com/ | sudo -E sh
wget -O- https://get.docker.com/ | sudo -E sh

Trouble Shooting

  • docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
systemctl start docker
  • docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create": dial unix /var/run/docker.sock: connect: permission denied.
sudo gpasswd -a $USER docker
sudo usermod -a -G docker $USER
newgrp docker

logout to take effect.

Mirror

# /etc/docker/daemon.json
cat << EOF > /etc/docker/daemon.json
{
	"registry-mirrors": ["https://b9b9x0p9.mirror.aliyuncs.com"]
}
EOF