在Debian 8上安装Docker

时间:2017-02-19 10:29:51

标签: linux docker debian overlay

使用apt-get -y安装docker-engine进行安装,如https://docs.docker.com/engine/installation/linux/debian/中所述,

失败
Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details.

systemctl status docker.service给出

● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled)
   Active: failed (Result: exit-code) since Sun 2017-02-19 11:03:55 CET; 1min 22s ago
     Docs: https://docs.docker.com
 Main PID: 5157 (code=exited, status=1/FAILURE)

Feb 19 11:03:55 v72089.1blu.de dockerd[5157]: time="2017-02-19T11:03:55.594281147+01:00" level=error msg="'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded."
Feb 19 11:03:55 v72089.1blu.de dockerd[5157]: time="2017-02-19T11:03:55.595650295+01:00" level=error msg="'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded."
Feb 19 11:03:55 v72089.1blu.de dockerd[5157]: time="2017-02-19T11:03:55.640984406+01:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
Feb 19 11:03:55 v72089.1blu.de dockerd[5157]: time="2017-02-19T11:03:55.642147968+01:00" level=warning msg="Your kernel does not support oom control"
Feb 19 11:03:55 v72089.1blu.de dockerd[5157]: time="2017-02-19T11:03:55.642181377+01:00" level=warning msg="Your kernel does not support memory swappiness"
Feb 19 11:03:55 v72089.1blu.de dockerd[5157]: time="2017-02-19T11:03:55.642199036+01:00" level=warning msg="Your kernel does not support kernel memory limit"
Feb 19 11:03:55 v72089.1blu.de dockerd[5157]: time="2017-02-19T11:03:55.642215415+01:00" level=warning msg="Unable to find cpu cgroup in mounts"
Feb 19 11:03:55 v72089.1blu.de dockerd[5157]: time="2017-02-19T11:03:55.642262936+01:00" level=warning msg="Unable to find cpuset cgroup in mounts"
Feb 19 11:03:55 v72089.1blu.de dockerd[5157]: time="2017-02-19T11:03:55.642312565+01:00" level=warning msg="mountpoint for pids not found"
Feb 19 11:03:55 v72089.1blu.de dockerd[5157]: Error starting daemon: Devices cgroup isn't mounted

覆盖模块似乎没有安装在我的发行版上(它是托管的虚拟服务器)。

uname -r
3.16.0-042stab120.11

lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.7 (jessie)
Release:    8.7
Codename:   jessie

使用apt-get install -t jessie-backports更新内核(https://backports.debian.org/Instructions/)linux-image-amd64将覆盖模块安装在/lib/modules/4.9.0-0.bpo.1-amd64/中kernel / fs / overlayfs / overlay.ko但是这仍然不允许我安装docker,我得到了与上面提到的相同的错误。

编辑:这是docker version告诉我的内容

Client:
 Version:      1.13.1
 API version:  1.26
 Go version:   go1.7.5
 Git commit:   092cba3
 Built:        Wed Feb  8 06:36:34 2017
 OS/Arch:      linux/amd64
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

编辑2:在VirtualBox Debian Jessie中我的Mac上的Docker没问题,这就是为什么我认为它是关于Debian发行版的原因。我发现的一个区别是在VB Debian中有存储驱动程序" aufs"安装,在托管的,既不是" aufs"也不是" overlay"。

这里有什么想法吗?我该怎么办?

PS:我不认为问题与该问题error starting docker daemon on ubuntu 14.04 (Devices cgroup isn't mounted)有关,因为他们没有存储驱动程序问题。

编辑3: 我试过这个:

root@v72089:~# cat  /etc/systemd/system/docker.service.d/00-execstart.conf
ExecStart=/usr/bin/dockerd -H fd:// --storage-driver aufs

root@v72089:~# systemctl daemon-reload && systemctl start docker
Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details.

root@v72089:~# systemctl status docker.service
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled)
  Drop-In: /etc/systemd/system/docker.service.d
           └─00-execstart.conf
   Active: failed (Result: exit-code) since Mon 2017-02-20 09:38:53 CET; 9s ago
     Docs: https://docs.docker.com
  Process: 29655 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
 Main PID: 29655 (code=exited, status=1/FAILURE)

Feb 20 09:38:53 v72089.1blu.de dockerd[29655]: time="2017-02-20T09:38:53.185963477+01:00" level=error msg="'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded."
Feb 20 09:38:53 v72089.1blu.de dockerd[29655]: time="2017-02-20T09:38:53.187730948+01:00" level=error msg="'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded."
Feb 20 09:38:53 v72089.1blu.de dockerd[29655]: time="2017-02-20T09:38:53.192048419+01:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
Feb 20 09:38:53 v72089.1blu.de dockerd[29655]: time="2017-02-20T09:38:53.192821521+01:00" level=warning msg="Your kernel does not support oom control"
Feb 20 09:38:53 v72089.1blu.de dockerd[29655]: time="2017-02-20T09:38:53.192846291+01:00" level=warning msg="Your kernel does not support memory swappiness"
Feb 20 09:38:53 v72089.1blu.de dockerd[29655]: time="2017-02-20T09:38:53.192862149+01:00" level=warning msg="Your kernel does not support kernel memory limit"
Feb 20 09:38:53 v72089.1blu.de dockerd[29655]: time="2017-02-20T09:38:53.192872455+01:00" level=warning msg="Unable to find cpu cgroup in mounts"
Feb 20 09:38:53 v72089.1blu.de dockerd[29655]: time="2017-02-20T09:38:53.192908839+01:00" level=warning msg="Unable to find cpuset cgroup in mounts"
Feb 20 09:38:53 v72089.1blu.de dockerd[29655]: time="2017-02-20T09:38:53.192954496+01:00" level=warning msg="mountpoint for pids not found"
Feb 20 09:38:53 v72089.1blu.de dockerd[29655]: Error starting daemon: Devices cgroup isn't mounted

root@v72089:~# dockerd --storage-driver overlay
INFO[0000] libcontainerd: new containerd process, pid: 29703
ERRO[0001] 'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded.
Error starting daemon: error initializing graphdriver: driver not supported

root@v72089:~# find / -name overlay*
/lib/modules/4.9.0-0.bpo.1-amd64/kernel/fs/overlayfs
/lib/modules/4.9.0-0.bpo.1-amd64/kernel/fs/overlayfs/overlay.ko

root@v72089:~# dockerd --storage-driver aufs
INFO[0000] libcontainerd: new containerd process, pid: 29735
Error starting daemon: error initializing graphdriver: driver not supported

root@v72089:~# dockerd --storage-driver devicemapper
INFO[0000] libcontainerd: new containerd process, pid: 29785
Error starting daemon: error initializing graphdriver: driver not supported

2 个答案:

答案 0 :(得分:0)

要切换到另一个存储驱动程序,可以将--storage-driver aufs添加到dockerd启动命令。使用systemd,我相信你可以简单地以root身份运行它:

mkdir -p /etc/systemd/system/docker.service.d
echo "ExecStart=/usr/bin/dockerd -H fd:// --storage-driver aufs" >/etc/systemd/system/docker.service.d/00-execstart.conf

然后systemctl daemon-reload && systemctl start docker。对于cgroups警告,ubuntu的链接答案应该有所帮助。 3.16是第一个支持docker的内核之一,因此并非所有这些内核都可以使用这些内容。

答案 1 :(得分:-1)

最终解决了我的问题:与服务器的主机交谈。他们似乎使用了一个不同的内核,无法安装Docker。我在同一台主机上更改了服务器,一切正常。