Linx's Solution

Install Docker on Debian

Debian 安装Docker

  1. 卸载旧的
sudo apt-get remove docker docker-engine docker.io containerd runc
  1. 安装下前戏
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/debian/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
  1. 正式安装
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

PS: 执行 curl 时错

curl: (77) error setting certificate verify locations:
  CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs

检查 /etc/ssl/certs 目录下是否有对应的文件, 如果没有, 则为不可抗力原因消失了, 重新安装 ca-certificates这个包即可.

sudo apt-get remove ca-certificates
sudo apt-get install ca-certificates