provisioners/docker: configure auto start properly for new Docker

[GH-2874]
This commit is contained in:
Mitchell Hashimoto 2014-01-21 20:52:27 -08:00
parent 2b9e7ca14e
commit 09955be2cd
4 changed files with 12 additions and 3 deletions

View File

@ -82,6 +82,8 @@ BUG FIXES:
- provisioners/chef: When chowning folders, don't follow symlinks.
- provisioners/docker: Only add SSH user to docker group if the user
isn't already in it. [GH-2838]
- provisioners/docker: Configuring autostart works properly with
the newest versions of Docker. [GH-2874]
- provisioners/salt: Options can now set install type and install args.
[GH-2766]
- synced\_folders/nfs: NFS entries are pruned on every `vagrant up`,

View File

@ -4,8 +4,12 @@ module VagrantPlugins
module Debian
module DockerConfigureAutoStart
def self.docker_configure_auto_start(machine)
if ! machine.communicate.test('grep -q \'\-r=true\' /etc/init/docker.conf')
machine.communicate.sudo("sed -i.bak 's/docker -d/docker -d -r=true/' /etc/init/docker.conf ")
machine.communicate.tap do |comm|
if !comm.test('grep -q \'\-r=true\' /etc/default/docker')
comm.sudo("echo 'DOCKER_OPTS=\"-r=true ${DOCKER_OPTS}\"' >> /etc/default/docker")
comm.sudo("stop docker")
comm.sudo("start docker")
end
end
end
end

View File

@ -16,7 +16,7 @@ module VagrantPlugins
end
if !@machine.guest.capability(:docker_installed)
@machine.ui.info(I18n.t("vagrant.docker_installing", version: @version.to_s))
@machine.ui.detail(I18n.t("vagrant.docker_installing", version: @version.to_s))
@machine.guest.capability(:docker_install, @version)
if !@machine.guest.capability(:docker_installed)
@ -25,6 +25,7 @@ module VagrantPlugins
end
if @machine.guest.capability?(:docker_configure_auto_start)
@machine.ui.detail(I18n.t("vagrant.docker_configure_autostart"))
@machine.guest.capability(:docker_configure_auto_start)
else
@machine.env.ui.warn I18n.t('vagrant.docker_auto_start_not_available')

View File

@ -46,6 +46,8 @@ en:
Vagrant doesn't support detecting whether Docker is installed
for the guest OS running in the machine. Vagrant will assume it is
installed and attempt to continue.
docker_configure_autostart: |-
Configuring Docker to autostart containers...
docker_install_with_version_not_supported: |-
Vagrant is not capable of installing an specific version of Docker
onto the guest machine and the latest version will be installed.