docker-1.4.1 (and possibly older versions) depends on /var/run existing. /etc/init.d/docker fails silently if /var/run does not exist. Solution: 1- Add DOCKER_HOST config option in conf.d/docker 2- Default it to file in /run 3- add env.d to set DOCKER_HOST to the same. Without 1 and 3, docker will not work out of the box (fails to start or client fails to connect). Reproducible: Always Steps to Reproduce: 1. remove /var/run (happens automatically on some systems) 2. /etc/init.d/docker start 3. Will indicate success, but daemon will not run.
Created attachment 395554 [details] docker-1.4.1-r1.ebuild
Created attachment 395556 [details, diff] Patch for upstream
Upstream pull request submitted.
Created attachment 395558 [details, diff] patch between 1.4.1 and 1.4.1-r1
Comment on attachment 395554 [details] docker-1.4.1-r1.ebuild --- docker-1.4.1.ebuild +++ docker-1.4.1-r1.ebuild @@ -20,7 +20,7 @@ [ "$DOCKER_GITCOMMIT" ] || die "DOCKER_GITCOMMIT must be added manually for each bump!" fi -inherit bash-completion-r1 linux-info multilib systemd udev user +inherit bash-completion-r1 linux-info multilib systemd udev user eutils LICENSE="Apache-2.0" SLOT="0" @@ -134,6 +134,8 @@ } src_prepare() { + # Don't use /var/run + epatch "${FILESDIR}/${P}-var-run.patch" # allow user patches (use sparingly - upstream won't support them) epatch_user } @@ -212,6 +214,9 @@ mkdir -p "${D}/usr/share/${PN}/contrib" cp -R contrib/* "${D}/usr/share/${PN}/contrib" fi + + echo -n "DOCKER_HOST=\"unix:///run/docker.unix\"" > "${T}/90docker" + doenvd "${T}/90docker" } pkg_postinst() {
i don't know if we've moved to supporting systems w/out /var/run entirely. there's really no reason for it to not be a symlink to /run.
Can we have a pronouncement on the correct way for the end user to fix their system, and shortly thereafter an updated ebuild in portage? The problem still manifests with current app-emulation/docker-1.8.2. I'd like to get Docker running on Gentoo ASAP. Thanks.
As follow-up I have attempted to the following, but docker-1.8.2 still doesn't run: % grep HOST /etc/conf.d/docker /etc/env.d/90docker /etc/conf.d/docker:DOCKER_HOST="unix:///run/docker.sock" /etc/env.d/90docker:DOCKER_HOST="unix:///run/docker.sock % grep docker /etc/group docker:x:993:myuser The socket files are created, persist after service stop, and are hardlinks of each other, all of which I presume is as intended: % /etc/init.d/docker zap * Manually resetting docker to stopped state % ls -al /var/run/docker.sock /run/docker.sock srw-rw---- 1 root docker 0 Sep 29 10:03 /run/docker.sock srw-rw---- 1 root docker 0 Sep 29 10:03 /var/run/docker.sock % sudo /etc/init.d/docker start * Starting docker daemon ... [ ok ] % sudo /etc/init.d/docker status * status: crashed % docker images Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
Are you sure it's the same problem? Sounds like you applied the workaround and it still crashes. Could you try using "vanilla" gentoo docker with /var/run -> /run symlink? Does system log show why docker is dying? You can always start daemon manually and see what's going on.
Thank you for the suggestion, you are correct: - applying the suggested fix in the original bug report at top works: - docker daemon wasn't starting on my system due to confusion about the storage driver. I had used aufs in the past, and use devicemapper today. % docker -d Warning: '-d' is deprecated, it will be removed soon. See usage. WARN[0000] please use 'docker daemon' instead. FATA[0000] Error starting daemon: open /var/run/docker.pid: permission denied % sudo docker daemon INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) FATA[0000] Error starting daemon: error initializing graphdriver: "/var/lib/docker" contains other graphdrivers: devicemapper; Please cleanup or explicitly choose storage driver (-s <DRIVER>) % sudo docker daemon -s devicemapper INFO[0000] Listening for HTTP on unix (/var/run/docker.sock) INFO[0000] Option DefaultDriver: bridge INFO[0000] Option DefaultNetwork: bridge INFO[0000] Firewalld running: false INFO[0000] Loading containers: start. .......................... INFO[0000] Loading containers: done. INFO[0000] Daemon has completed initialization INFO[0000] Docker daemon commit=0a8c2e3 execdriver=native-0.2 graphdriver=devicemapper version=1.8.2 ^CINFO[0013] Processing signal 'interrupt' The docker init script should use 'docker daemon' instead of 'docker -d' which is to be deprecated.
Should not be a problem for really long time.