ubuntu安裝docker-ce

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

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

如下是官網的安裝文檔,涉及到各類操做系統的安裝方式docker

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

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

===============================================ui

0x01 卸載之前版本&updatespa

卸載以前版本的docker:操作系統

#若是是docker.iocode

apt-get remove docker.io

#若是是docker-ceblog

apt-get remove docker-ce

以後,更新一下老是沒有錯的。開發

apt-get update

 

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

ubuntu的docker-ce鏡像:

https://download.docker.com/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
相關文章
相關標籤/搜索