ubuntu 安裝docker
1.更新現有的包列表
sudo apt update
2.使用apt安裝一些允許通過HTTPS才能使用的軟件包:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
3.將官方Docker存儲庫的GPG密鑰添加到您的系統:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
4.將Docker存儲庫添加到APT源:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
5.接下來,使用新添加的repo源中的Docker包更新包數據庫:
sudo apt update
6.列出可用版本
apt-cache madison docker-ce
7.安裝最新版本docker或者安裝制定版本docker
sudo apt-get install docker-ce docker-ce-cli containerd.io
sudo apt-get install docker-ce=<VERSION_STRING> docker-ce-cli=<VERSION_STRING> containerd.io
8.將普通用戶加入到docker組
sudo groupadd docker
sudo gpasswd -a ${USER} docker