2013-11-26 21:48:51 +00:00
|
|
|
module VagrantPlugins
|
2014-03-26 23:32:31 +00:00
|
|
|
module DockerProvisioner
|
2013-12-12 19:54:20 +00:00
|
|
|
class Installer
|
2015-11-20 01:45:16 +00:00
|
|
|
def initialize(machine)
|
2013-11-26 21:48:51 +00:00
|
|
|
@machine = machine
|
|
|
|
end
|
|
|
|
|
|
|
|
# This handles verifying the Docker installation, installing it if it was
|
|
|
|
# requested, and so on. This method will raise exceptions if things are
|
|
|
|
# wrong.
|
|
|
|
def ensure_installed
|
|
|
|
if !@machine.guest.capability?(:docker_installed)
|
|
|
|
@machine.ui.warn(I18n.t("vagrant.docker_cant_detect"))
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2015-11-20 02:25:28 +00:00
|
|
|
if !@machine.guest.capability(:docker_installed)
|
|
|
|
@machine.ui.detail(I18n.t("vagrant.docker_installing"))
|
|
|
|
@machine.guest.capability(:docker_install)
|
|
|
|
end
|
2013-11-26 21:48:51 +00:00
|
|
|
|
2015-08-07 17:44:08 +00:00
|
|
|
if !@machine.guest.capability(:docker_installed)
|
2015-11-20 02:25:28 +00:00
|
|
|
raise DockerError, :install_failed
|
2013-11-26 21:48:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
if @machine.guest.capability?(:docker_configure_vagrant_user)
|
|
|
|
@machine.guest.capability(:docker_configure_vagrant_user)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|