curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
如果出现:
The program 'curl' is currently not installed. You can install it by typing:
sudo apt install curl
先安装 curl : sudo apt install curl
再添加GPC密钥,回车看到ok就可以了。
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update && sudo apt install docker-ce
sudo usermod -aG docker $USER
PS:需重新登录才能使更改生效。