ubuntu安裝docker


1.首次安裝Docker CE之前,需要先設置Docker倉庫

$ sudo apt-get update

 

2.允許apt通過Https更新

$ sudo apt-get 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 -

通過搜索密鑰的最后8個字符,確認您現在已經擁有指紋 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 的密鑰。

$ sudo apt-key fingerprint 0EBFCD88

使用以下命令來設置 stable 的倉庫。即使你想從 edge __ 或 __test 倉庫安裝構建,也總是需要 stable 的倉庫。要添加 edge __ 或 __test 倉庫,請在下面的命令中在單詞stable之后添加edge或test(或兩者)

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

4.開始安裝Docker CE

$ sudo apt-get install docker-ce

5.選擇版本

$ apt-cache madison docker-ce

6.安裝選擇的版本

$ sudo apt-get install docker-ce=VERSION

7.通過運行hello-world 鏡像驗證Docker CE是否正確安裝

$ sudo docker run hello-world

8.查看版本

$ sudo docker version 

 


免責聲明!

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



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