Docker 1.4.1无法在Fedora 21上启动:FATA

最近我的本地Fedora 21上的docker服务停止工作。 当我尝试运行守护进程使用:

 sudo systemctl start docker 

它结束于:

 Job for docker.service failed. See "systemctl status docker.service" and "journalctl -xe" for details. 

通过sudo systemctl status docker检查docker状态

 ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled) Active: failed (Result: exit-code) since pon 2015-02-09 10:37:44 CET; 5s ago Docs: http://docs.docker.com Process: 2673 ExecStart=/usr/bin/docker -d $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS (code=exited, status=1/FAILURE) Main PID: 2673 (code=exited, status=1/FAILURE) lut 09 10:37:44 localhost.localdomain docker[2673]: time="2015-02-09T10:37:44+01:00" level="debug" msg="Registering POST, /exec/{name:.*}/start" lut 09 10:37:44 localhost.localdomain docker[2673]: time="2015-02-09T10:37:44+01:00" level="debug" msg="Registering DELETE, /containers/{name:.*}" lut 09 10:37:44 localhost.localdomain docker[2673]: time="2015-02-09T10:37:44+01:00" level="debug" msg="Registering DELETE, /images/{name:.*}" lut 09 10:37:44 localhost.localdomain docker[2673]: No sockets found lut 09 10:37:44 localhost.localdomain docker[2673]: time="2015-02-09T10:37:44+01:00" level="info" msg="-job serveapi(fd://, tcp://0.0.0.0:2376) = ERR (1)" lut 09 10:37:44 localhost.localdomain docker[2673]: time="2015-02-09T10:37:44+01:00" level="fatal" msg="No sockets found" lut 09 10:37:44 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE lut 09 10:37:44 localhost.localdomain systemd[1]: Failed to start Docker Application Container Engine. lut 09 10:37:44 localhost.localdomain systemd[1]: Unit docker.service entered failed state. lut 09 10:37:44 localhost.localdomain systemd[1]: docker.service failed. 

原来没有/var/run/docker.sock套接字,在启动docker服务时无法创build。 如果我尝试运行它:

 sudo docker -d 

它结束于:

 [1] % sudo docker -d INFO[0000] +job serveapi(unix:///var/run/docker.sock) INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) FATA[0000] EOF 

添加-D选项:

 [1] % sudo docker -d -D INFO[0000] +job serveapi(unix:///var/run/docker.sock) INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) DEBU[0000] Registering GET, /version DEBU[0000] Registering GET, /images/json DEBU[0000] Registering GET, /containers/{name:.*}/top DEBU[0000] Registering GET, /containers/{name:.*}/logs DEBU[0000] Registering GET, /images/viz DEBU[0000] Registering GET, /images/search DEBU[0000] Registering GET, /containers/ps DEBU[0000] Registering GET, /containers/json DEBU[0000] Registering GET, /containers/{name:.*}/changes DEBU[0000] Registering GET, /containers/{name:.*}/json DEBU[0000] Registering GET, /_ping DEBU[0000] Registering GET, /events DEBU[0000] Registering GET, /info DEBU[0000] Registering GET, /images/{name:.*}/json DEBU[0000] Registering GET, /images/get DEBU[0000] Registering GET, /images/{name:.*}/get DEBU[0000] Registering GET, /images/{name:.*}/history DEBU[0000] Registering GET, /containers/{name:.*}/export DEBU[0000] Registering GET, /containers/{name:.*}/attach/ws DEBU[0000] Registering GET, /exec/{id:.*}/json DEBU[0000] Registering POST, /containers/{name:.*}/copy DEBU[0000] Registering POST, /containers/{name:.*}/exec DEBU[0000] Registering POST, /exec/{name:.*}/start DEBU[0000] Registering POST, /exec/{name:.*}/resize DEBU[0000] Registering POST, /commit DEBU[0000] Registering POST, /containers/{name:.*}/pause DEBU[0000] Registering POST, /containers/{name:.*}/resize DEBU[0000] Registering POST, /containers/{name:.*}/start DEBU[0000] Registering POST, /containers/{name:.*}/attach DEBU[0000] Registering POST, /auth DEBU[0000] Registering POST, /containers/{name:.*}/kill DEBU[0000] Registering POST, /containers/{name:.*}/unpause DEBU[0000] Registering POST, /images/{name:.*}/tag DEBU[0000] Registering POST, /containers/{name:.*}/restart DEBU[0000] Registering POST, /containers/{name:.*}/stop DEBU[0000] Registering POST, /containers/{name:.*}/wait DEBU[0000] Registering POST, /build DEBU[0000] Registering POST, /images/load DEBU[0000] Registering POST, /images/{name:.*}/push DEBU[0000] Registering POST, /images/create DEBU[0000] Registering POST, /containers/create DEBU[0000] Registering DELETE, /containers/{name:.*} DEBU[0000] Registering DELETE, /images/{name:.*} DEBU[0000] Registering OPTIONS, DEBU[0000] docker group found. gid: 977 DEBU[0000] Generated prefix: docker-8:3-6961299 DEBU[0000] Checking for existence of the pool 'docker-8:3-6961299-pool' FATA[0000] EOF 

它在几天前工作,docker总是运行的选项:

 --selinux-enabled -D -H fd:// -H tcp://0.0.0.0:2376 --bip=172.17.42.1/16 --dns=172.17.42.1 --dns-search=docker 

我的问题是 :什么可能是问题的根源? Docker在几天前顺利运行。 根据yum.log 2月5日更新了yum.log docker-io的更新yum.log

 [0] % sudo tail -n 100 /var/log/yum.log | grep dock Feb 05 18:49:42 Updated: docker-io-1.4.1-8.fc21.x86_64 

更多关于我的操作系统

Fedora 21 Linux 3.18.5-201.fc21.x86_64 #1 SMP Mon Feb 2 21:00:58 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Docker Docker version 1.4.1, build 5bc2ff8/1.4.1

PS:我以前的docker版本是:

 Dec 15 20:34:33 Updated: docker-io-1.4.0-1.fc21.x86_64 

UPDATE

事实certificate,这个问题与docker-1.4.1无关,我已经尝试降级到1.4.0和1.3.2,结果相同。 我检查了我的日志,最后一次确实是在2月4日。 从那时起,几个包被更新了,下面是yum.log的完整列表:

 Feb 05 18:49:31 Updated: claws-mail-3.11.1-3.fc21.x86_64 Feb 05 18:49:31 Updated: claws-mail-plugins-pgp-3.11.1-3.fc21.x86_64 Feb 05 18:49:31 Updated: firewalld-filesystem-0.3.13-2.fc21.noarch Feb 05 18:49:31 Updated: 1:xscreensaver-base-5.32-4.fc21.x86_64 Feb 05 18:49:32 Installed: python2-firewall-0.3.13-2.fc21.noarch Feb 05 18:49:32 Updated: firewalld-config-standard-0.3.13-2.fc21.noarch Feb 05 18:49:32 Updated: firewalld-0.3.13-2.fc21.noarch Feb 05 18:49:32 Updated: 1:xscreensaver-extras-base-5.32-4.fc21.x86_64 Feb 05 18:49:32 Updated: 1:xscreensaver-extras-5.32-4.fc21.x86_64 Feb 05 18:49:32 Updated: firewall-config-0.3.13-2.fc21.noarch Feb 05 18:49:32 Updated: claws-mail-plugins-smime-3.11.1-3.fc21.x86_64 Feb 05 18:49:32 Updated: claws-mail-plugins-vcalendar-3.11.1-3.fc21.x86_64 Feb 05 18:49:32 Updated: claws-mail-plugins-tnef-3.11.1-3.fc21.x86_64 Feb 05 18:49:32 Updated: claws-mail-plugins-newmail-3.11.1-3.fc21.x86_64 Feb 05 18:49:32 Updated: claws-mail-plugins-fetchinfo-3.11.1-3.fc21.x86_64 Feb 05 18:49:33 Updated: claws-mail-plugins-notification-3.11.1-3.fc21.x86_64 Feb 05 18:49:33 Updated: claws-mail-plugins-att-remover-3.11.1-3.fc21.x86_64 Feb 05 18:49:33 Updated: claws-mail-plugins-mailmbox-3.11.1-3.fc21.x86_64 Feb 05 18:49:33 Updated: claws-mail-plugins-rssyl-3.11.1-3.fc21.x86_64 Feb 05 18:49:33 Updated: claws-mail-plugins-attachwarner-3.11.1-3.fc21.x86_64 Feb 05 18:49:33 Updated: claws-mail-plugins-archive-3.11.1-3.fc21.x86_64 Feb 05 18:49:33 Updated: claws-mail-plugins-spam-report-3.11.1-3.fc21.x86_64 Feb 05 18:49:33 Updated: xfdashboard-0.3.8-1.fc21.x86_64 Feb 05 18:49:33 Updated: patch-2.7.4-1.fc21.x86_64 Feb 05 18:49:33 Updated: gparted-0.20.0-1.fc21.x86_64 Feb 05 18:49:33 Updated: tbb-4.3-1.20141204.fc21.x86_64 Feb 05 18:49:41 Updated: google-chrome-stable-40.0.2214.111-1.x86_64 Feb 05 18:49:41 Updated: openal-soft-1.16.0-4.fc21.x86_64 Feb 05 18:49:41 Updated: xorg-x11-drv-synaptics-1.8.1-2.fc21.x86_64 Feb 05 18:49:42 Updated: docker-io-1.4.1-8.fc21.x86_64 Feb 05 18:49:42 Updated: polkit-0.112-7.fc21.1.x86_64 Feb 07 09:22:29 Installed: kernel-core-3.18.5-201.fc21.x86_64 Feb 07 09:22:32 Installed: kernel-modules-3.18.5-201.fc21.x86_64 Feb 07 09:22:32 Installed: ocl-icd-2.0.4-3.git20131001.4ee231e.fc21.x86_64 Feb 07 09:22:33 Updated: ffmpeg-libs-2.4.6-2.fc21.x86_64 Feb 07 09:22:33 Installed: libavdevice-2.4.6-2.fc21.x86_64 Feb 07 09:22:35 Installed: kmod-VirtualBox-3.18.5-201.fc21.x86_64-4.3.20-4.fc21.2.x86_64 Feb 07 09:22:49 Updated: selinux-policy-3.13.1-105.1.fc21.noarch Feb 07 09:22:49 Updated: kernel-tools-libs-3.18.5-201.fc21.x86_64 Feb 07 09:22:49 Updated: mplayer-common-1.1-32.20150123svn.fc21.x86_64 Feb 07 09:22:49 Updated: mplayer-1.1-32.20150123svn.fc21.x86_64 Feb 07 09:22:49 Updated: kernel-tools-3.18.5-201.fc21.x86_64 Feb 07 09:23:05 Updated: selinux-policy-targeted-3.13.1-105.1.fc21.noarch Feb 07 09:23:05 Updated: kmod-VirtualBox-4.3.20-4.fc21.2.x86_64 Feb 07 09:23:05 Updated: ffmpeg-2.4.6-2.fc21.x86_64 Feb 07 09:23:05 Installed: kernel-3.18.5-201.fc21.x86_64 Feb 07 09:23:08 Installed: kernel-modules-extra-3.18.5-201.fc21.x86_64 Feb 07 09:23:08 Updated: rubygem-nokogiri-1.6.6.2-1.fc21.x86_64 Feb 07 09:23:23 Installed: kernel-devel-3.18.5-201.fc21.x86_64 Feb 07 09:23:23 Updated: kernel-headers-3.18.5-201.fc21.x86_64 Feb 07 09:23:23 Updated: wkhtmltopdf-0.12.2.1-1.fc21.x86_64 Feb 07 09:23:23 Erased: kmod-VirtualBox-3.17.7-300.fc21.x86_64-4.3.20-2.fc21.2.x86_64 Feb 07 09:23:26 Erased: kmod-acpi_call-3.17.7-300.fc21.x86_64-1.1.0-3.fc21.x86_64 Feb 07 09:23:28 Erased: kmod-tp_smapi-3.17.7-300.fc21.x86_64-0.41-5.fc21.x86_64 Feb 07 09:23:57 Installed: kmod-acpi_call-3.18.5-201.fc21.x86_64-1.1.0-3.fc21.x86_64 Feb 07 09:24:01 Installed: kmod-tp_smapi-3.18.5-201.fc21.x86_64-0.41-5.fc21.x86_64 Feb 09 09:21:36 Updated: postgresql-libs-9.3.6-1.fc21.x86_64 Feb 09 09:21:36 Updated: postgresql-9.3.6-1.fc21.x86_64 Feb 09 09:21:36 Updated: libdrm-2.4.59-4.fc21.x86_64 Feb 09 09:21:36 Updated: libdrm-devel-2.4.59-4.fc21.x86_64 Feb 09 09:21:37 Updated: postgresql-contrib-9.3.6-1.fc21.x86_64 Feb 09 09:21:37 Updated: postgresql-server-9.3.6-1.fc21.x86_64 Feb 09 09:21:37 Updated: 1:lpf-flash-plugin-11.2.202.442-1.fc21.x86_64 Feb 09 09:21:38 Updated: imlib2-1.4.6-3.fc21.x86_64 Feb 09 09:21:38 Updated: libgadu-1.12.1-1.fc21.x86_64 Feb 09 09:21:38 Updated: 1:perl-Digest-SHA-5.95-1.fc21.x86_64 Feb 09 09:21:38 Updated: 2:qemu-guest-agent-2.1.3-1.fc21.x86_64 Feb 09 09:21:39 Updated: 2:gedit-3.14.3-1.fc21.x86_64 Feb 09 09:21:39 Updated: xorg-x11-drv-synaptics-1.8.1-3.fc21.x86_64 Feb 09 09:21:39 Updated: libdrm-2.4.59-4.fc21.i686 

其中一个升级的软件包可能会与docker产生冲突。 我也尝试切换到几个不同的内核版本,例如3.18.5-201.fc21.x86_64,3.18.3-201.fc21.x86_64和3.17.8-300.fc21.x86_64,但结果是一样的。

我被要求发布解决scheme作为答案,所以在这里。

好的,我发现问题是什么 – 当然是/etc/sysconfig/docker的dockerconfiguration。 我采取的步骤找出来:

  • 首先,我将/var/lib/docker/重命名为允许docker重新创build其文件结构(我决定在阅读https://bugzilla.redhat.com/show_bug.cgi?id=1099375后试用) – 这有助于sudo systemctl docker start运行没有错误,
  • 但之前我这样做,我重新安装docker,所以我以前的docker设置丢失 – 我添加了他们,并重新启动:它失败了,
  • 我不得不删除-H fd:// -H tcp://0.0.0.0:2376 ,这似乎是boot2docker所需的一些设置(我的同伴在MacOS和Windows上使用b2d),
  • 我还被要求添加-s overlay来运行选项。

它解决了这个问题。 它也适用于以前的/var/lib/docker/目录(至less我不必再次下载所有的容器)。

@marekgoldmann也指出了我的问题 – https://bugzilla.redhat.com/show_bug.cgi?id=1186669#c2 ,尤其是它的bugzilla的解释。 谢谢Marek对你的帮助! 🙂

我希望这篇文章可以帮助你,如果你遇到与docker相似的问题。