docker 安装
1. 首先移除老的docker版本
sudo apt-get remove docker docker-engine docker.io containerd runc
2. apt 更新
sudo apt-get update
若出现GPG error: https://www.rabbitmq.com/debian testing InRelease: The following signatures couldn‘t be verified because the public key is not available: NO_PUBKEY 6B73A36E6026DFCA错误,使用以下步骤解决
sudo apt-get clean sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 696DBE66A72D76DA sudo apt update sudo apt-get update
3.安装ca HTTPS等依赖
sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common
4. 添加docker gpg key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
5.安装docker
sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io
然后就完成安装了
完成后可以 使用命令
sudo docker run hello-world
测试一下是否成功
原文:https://www.cnblogs.com/bigyu/p/10859627.html