安装docker
如果有旧版本的docker就需要先卸载:
sudo apt-get remove docker docker-ce docker.io containerd runc
更新系统里的所有软件:
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
# 卸载旧版本docker
sudo apt-get remove docker docker-engine docker.io containerd runc
# 更新系统里的所有的能更新的软件
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release
# 增加一个docker的官方GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# 下载仓库文件
echo \
"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# 安装docker
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io -y
ps aux|grep docker
# 测试运行一个docker容器
sudo docker run hello-world
标签:gpg,get,sudo,apt,https,ubuntu,Docker,安装,docker
From: https://www.cnblogs.com/imawuya/p/17937917