Ununto16.04版本Docker的安裝2018年最新版本
阿新 • • 發佈:2017-12-07
sta mage drive pri brush stream down 和我 sport 安裝store driver
最近參照網上教程安裝ubuntu的Docker怎麽都不成功,我最後參照官方文檔成功安裝
https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#if-you-need-to-use-aufs
大家可以先不筆管具體的細節,我把需要粘貼的代碼放到下面。大家一步步安裝就好,如果遇到問題可以留言。
我是用的鏡像就是官網直接下載的16.04鏡像
首先刪除舊版本
$ sudo apt-get remove docker docker-engine docker.io
安裝store driver aufs
驅動
$ sudo apt-get update $ sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
設定數據倉庫
設置apt可以通過HTTPS方式訪問
$ sudo apt-get update
$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
添加官方GPG key:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
驗證你已經添加成功,第一行是代碼,後面是結果
$ sudo apt-key fingerprint 0EBFCD88 pub 4096R/0EBFCD88 2017-02-22 Key fingerprint = 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 uid Docker Release (CE deb) <[email protected]> sub 4096R/F273FCD8 2017-02-22
設定穩定版本的數據倉庫
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" $ sudo add-apt-repository "deb [arch=armhf] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" $ sudo add-apt-repository "deb [arch=s390x] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
安裝Docker CE
$ sudo apt-get update
$ sudo apt-get install docker-ce
驗證是否安裝成功,和centos不同不需要啟動服務
$ sudo docker run hello-world
輸出如下則表示安裝成功
Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.
以上過程傻瓜式的照搬就可以,時間是2017年12月7日,所以如果大家采用了和我一個版本的unbutn鏡像文件,應該是可以安裝成功的
Ununto16.04版本Docker的安裝2018年最新版本