ubuntu安裝docker-ce


Docker Community Edition (CE)/Docker社區版非常適合希望開始使用Docker並嘗試使用基於容器的應用程序的開發人員和小型團隊。Docker CE有2個版本:stable and edge:

  • Stable:每一個季度提供穩定的更新
  • Edge:每一個月都有新的功能

以下是官網的安裝文檔,涉及到各種操作系統的安裝方式

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

本文淺嘗輒止,在ubuntu14.04上安裝最新版的Dokcer CE Stable,並且都是以root來運行。

===============================================

0x01 卸載以前版本&update

卸載之前版本的docker:

#如果是docker.io

apt-get remove docker.io

#如果是docker-ce

apt-get remove docker-ce

之后,更新一下總是沒有錯的。

apt-get update

 

0x02 基於deb安裝包來安裝docker-ce

ubuntu的docker-ce鏡像:

https://download.docker.com/linux/ubuntu/dists/

(推薦國內清華源  https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu/dists/

這里我是選擇14.04(trusty)的最新版Dokcer CE Stable

https://download.docker.com/linux/ubuntu/dists/trusty/pool/stable/amd64/

這里面目前最新的是2017-09-27 01:48的docker-ce_17.09.0~ce-0~ubuntu_amd64.deb

下載后放在ubuntu目錄下,運行

dpkg -i docker-ce_17.09.0~ce-0~ubuntu_amd64.deb

(補充:16.04/xenial https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/amd64/

18.04/bionic https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/

-= 2019.05補充 =-

16.04以上的docker-ce最新版本安裝時報錯:

docker-ce depends on docker-ce-cli
docker-ce depends on containerd.io (>= 1.2.2-3)

解決法子,再去其下載目錄下載docker-ce-cli和containerd.io分別進行安裝。

 

0x03 libltdl7和libsystemd-journal0依賴問題

當安裝時候報錯如下:

dpkg: dependency problems prevent configuration of docker-ce:
 docker-ce depends on libltdl7 (>= 2.4.2); however:
  Package libltdl7 is not installed.
 docker-ce depends on libsystemd-journal0 (>= 201); however:
  Package libsystemd-journal0 is not installed.

dpkg: error processing package docker-ce (--install):
 dependency problems - leaving unconfigured
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Errors were encountered while processing:
 docker-ce

先安裝libltdl7和libsystemd-journal0

apt-get install -y libltdl7 libsystemd-journal0

安裝后再去安裝docker-ce即可

安裝好后運行docker -v,得到

Docker version 17.09.0-ce, build afdb6d4

 

0x04 libltdl7和libseccomp2依賴問題

當安裝libltdl7報錯如下:

Depends: libseccomp2 (>= 2.3.0) but 2.2.3-3ubuntu3 is to be installed
             Recommends: aufs-tools but it is not going to be installed

只需要:

apt-get install -y libltdl7 libseccomp2

 

0x05 缺少libltdl.so.7

報錯如下:

docker: error while loading shared libraries: libltdl.so.7: cannot open shared object file: No such file or directory

也是因為沒安裝好libltdl7

apt-get install -y libltdl7

 


免責聲明!

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



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