Docker 1.4.1 无法在 Fedora 21 上启动:FATA[0000] EOF

Docker 1.4.1 fails to start on Fedora 21: FATA[0000] EOF

最近我在本地 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服务时无法创建。如果我尝试 运行 它:

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 日 docker-io 的更新发生了变化
[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

关于我的 OS 的更多详细信息:

软呢帽 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

更新

原来这个问题与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 但结果是一样的.

我被要求post解决方案作为答案,所以就在这里。

解决方案

好的,我发现了问题所在 - 当然是我在 /etc/sysconfig/docker 中的 docker 配置。我采取的步骤:

  • 首先,我重命名了 /var/lib/docker/ 以允许 docker 重新创建其文件结构(我决定在阅读 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/ 目录(至少我不必再次下载所有容器)。

@marekgoldmann also pointed me to that issue - https://bugzilla.redhat.com/show_bug.cgi?id=1186669#c2 尤其是它对 bugzilla 的解释。感谢 Marek 的热心帮助! :)

如果您 运行 遇到与 docker 非常相似的问题,我希望这篇 post 可以帮助您。