From ac8d54132bdaeb9fa2e94dd62956fda1e5707cc9 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 15 Apr 2014 12:15:14 -0700 Subject: [PATCH] provisioners/docker: UPDATE CHANGELOG --- CHANGELOG.md | 2 ++ .../docker/cap/debian/docker_configure_auto_start.rb | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17d2a6119..05b15794b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ BUG FIXES: - guests/coreos: Fix test for Docker daemon running. - guests/linux: Fix test for Docker provisioner whether Docker is running. + - provisioners/docker: Fix issue where we weren't waiting for Docker + to properly start before issuing commands. [GH-3482] ## 1.5.3 (April 14, 2014) diff --git a/plugins/provisioners/docker/cap/debian/docker_configure_auto_start.rb b/plugins/provisioners/docker/cap/debian/docker_configure_auto_start.rb index 4f6634170..f8a225609 100644 --- a/plugins/provisioners/docker/cap/debian/docker_configure_auto_start.rb +++ b/plugins/provisioners/docker/cap/debian/docker_configure_auto_start.rb @@ -9,9 +9,13 @@ module VagrantPlugins comm.sudo("echo 'DOCKER_OPTS=\"-r=true ${DOCKER_OPTS}\"' >> /etc/default/docker") comm.sudo("stop docker") comm.sudo("start docker") + + # Wait some amount time for the pid to become available + # so that we don't start executing Docker commands until + # it is available. [0, 1, 2, 4].each do |delay| sleep delay - break if comm.test('test -f /var/run/docker.pid') + break if machine.guest.capability(:docker_daemon_running) end end end