(原)ubuntu14及ubuntu16中安裝docker


轉載請注明出處:

http://www.cnblogs.com/darkknightzh/p/5653739.html

參考網址:

http://blog.csdn.net/yangzhenping/article/details/43671843

https://docs.docker.com/engine/installation/linux/ubuntulinux/

http://blog.csdn.net/xundh/article/details/46441403

 

1. 由於老版本的docker支持的命令很少,因而需要卸載老版本的docker

http://blog.csdn.net/yangzhenping/article/details/43671843

sudo docker -v  
sudo apt-get remove docker 

老版本的docker支持的命令:

 

2. ubuntu14上面重新安裝新版本的docker

http://blog.csdn.net/xundh/article/details/46441403

直接使用如下命令即可

wget -qO- https://get.docker.com/ | sh

q后面是大寫字母O

說明:有時候賦值上面這句話,就是提示有問題,去上面的網址復制,就可以執行。。。

 

3. ubuntu16上面重新安裝新版本的docker

參考docker官方文檔(https://docs.docker.com/engine/installation/linux/ubuntulinux/

說明:a. 上面網址有16.04,15.10,14.04,12.04的安裝步驟。接下來只說在ubuntu16上怎么安裝。

b. ubuntu內核最低為3.10.使用如下命令查看內核版本:

uname -r

1更新apt源:

① ensure that APT works with the https method, and that CA certificates are installed

終端中輸入如下命令:

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates

② 增加新的GPG key

sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

③ 打開/etc/apt/sources.list.d/docker.list文件,刪除里面的所有內容(需要超級管理員權限);如果不存在,創建。

④ 在③中的文件中增加 entry,並保存該文件:

deb https://apt.dockerproject.org/repo ubuntu-xenial main

注意:其他版本中的請查看上面的網址。Docker does not provide packages for all architectures. You can find nightly built binaries in https://master.dockerproject.org. To install docker on a multi-architecture system, add an [arch=...] clause to the entry. Refer to the Debian Multiarch wiki for details.

說明:之前安裝docker時,只能安裝到1.10,后來打開該文件,發現源不對。更改了之后,后面安裝的就是最新的了。

⑤ 更新apt

sudo apt-get update

⑥ 如果有的話,清除老的repo

sudo apt-get purge lxc-docker

⑦ Verify that APT is pulling from the right repository.

apt-cache policy docker-engine

2)安裝docker

① 終端中輸入:

sudo apt-get update

② 安裝docker:

sudo apt-get install docker-engine

③ Start the docker daemon:

sudo service docker start

④ 驗證docker成功安裝:

sudo docker run hello-world

結果如下:

可選的配置:見參考網址。

 

4. 新版本的docker

新版本docker支持的命令:

 


免責聲明!

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



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