一、設定倉庫
1.更新apt包索引
- apt-get update
2.安裝軟體包,使它允許apt通過HTTPS使用倉庫
- 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 的密鑰

4.使用以下命令來設定 stable 的倉庫,即使你想從 _edge _ 或 test 倉庫安裝構建,也總是需要 stable 的倉庫,要添加 _edge _ 或 test 倉庫,請在下面的命令中在單詞stable之后添加edge或test(或兩者)
-
這里我選擇添加test

二、安裝docker ce
1.更新apt包索引
- apt-get update
2.安裝最新版本有 Dcoker CE
- apt-get install docker-ce
3.通過運行hello-world 鏡像驗證Docker CE是否正確安裝
-
docker run hello-world

轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/155264.html
標籤:Linux
上一篇:Shell腳本(1)
