1、docker的安装
官网https://docs.docker.com/engine/install/为我们提供了三种安装方式。
使用存储库安装
从软件包安装
使用便捷脚本安装
官方推荐的是第一种,我里我也采用第一种方法,需要注意需要根据自己的系统和对应版本进行选择。这里我以我的Ubuntu(18.04.4)为例,
(1)设置存储库
1.更新apt
软件包索引并安装软件包以允许apt
通过HTTPS使用存储库:
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
2、添加Docker的官方GPG密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -9DC8 5822 9FC7 DD38 854A E2D8 8D81 803