ubuntu環境安裝docker

查看已安裝的docker

apt list docker*

如果已安裝,並且需要卸載,則執行以下命令:

apt remove docker*

更新apt索引

apt update

apt需要支持HTTPS

apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common

添加Docker的GPG Key

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

添加docker源

add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"

再次更新apt索引

apt update

安裝docker

apt install docker-ce

參考鏈接:

https://docs.docker.com/install/linux/docker-ce/ubuntu/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章