- 卸載舊版本
sudo apt remove docker docker-engine docker.io containerd runc
- 設(shè)置存儲庫
sudo apt update
sudo apt install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
- 添加官方GPG密鑰:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- 設(shè)置穩(wěn)定的存儲庫
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
- 安裝docker引擎
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io
- 運行hello-world驗證docker是否正確安裝
sudo docker run hello-world
用非root管理docker
- 創(chuàng)建docker組
sudo groupadd docker
- 將用戶添加到docker組中
sudo usermod -aG docker $USER
- 注銷并重新登錄使更改生效姑食,或者使用下面的命令激活對組的更改(Linux)
newgrp docker
- 驗證
docker run hello-world
修改docker使用國內(nèi)鏡像源
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者