vim /etc/apt/sources.list 在最后面添加docke-ce源: deb http://mirrors.aliyun.com/docker-ce/linux/ubuntu/ xenial stable apt-get update 更新源可能会提示没有公钥(The following signatures couldn't be verified because the public key is not available: NO_PUBKEY XXXX) 执行如下命令添加公钥: apt-key adv --recv-keys --keyserver keyserver.ubuntu.com XXXXXX (添加失败报错 gpg: keyserver receive failed: Server indicated a failure 参考https://www.codeleading.com/article/89801020493/) 再次更新源就可以了 apt-get update 再安装这三个相关工具包 apt-get install docker docker-ce docker-ce-cli 安装完成后,查看docker服务是否正常。 执行命令 systemctl stop docker systemctl status docker systemctl start docker systemctl status docker