ubuntu16.04純凈版-安裝Docker


想要在Linux服務器上部署一個qq機器人玩,需要Docker才能運行


 

開始安裝

由於apt官方庫里的docker版本可能比較舊,所以先卸載可能存在的舊版本:

sudo apt-get remove docker docker-engine docker-ce docker.io

更新apt包索引:

sudo apt-get update

安裝以下包以使apt可以通過HTTPS使用存儲庫(repository):

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

添加Docker官方的GPG密鑰:

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

使用下面的命令來設置stable存儲庫:

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

再更新一下apt包索引:

sudo apt-get update

安裝最新版本的Docker CE:

sudo apt-get install -y docker-ce

驗證docker

查看docker服務是否啟動:

systemctl status docker

 

 若未啟動,則啟動docker服務:

sudo systemctl start docker

經典的hello world:

sudo docker run hello-world

 

 有以上輸出,表示docker安裝成功.

參考博客:https://blog.csdn.net/jinking01/article/details/82490688


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM