Sha256: b8785782f7226fa52fc9d46115bbf06865986cf9f5eea216f476bab5c3df3a6b

Contents?: true

Size: 1.15 KB

Versions: 12

Compression:

Stored size: 1.15 KB

Contents

require_relative "../container/installer"

module VagrantPlugins
  module DockerProvisioner
    class Installer < VagrantPlugins::ContainerProvisioner::Installer
      # This handles verifying the Docker installation, installing it if it was
      # requested, and so on. This method will raise exceptions if things are
      # wrong.
      # @return [Boolean] - false if docker cannot be detected on machine, else
      #                     true if docker installs correctly or is installed
      def ensure_installed
        if !@machine.guest.capability?(:docker_installed)
          @machine.ui.warn(I18n.t("vagrant.docker_cant_detect"))
          return false
        end

        if !@machine.guest.capability(:docker_installed)
          @machine.ui.detail(I18n.t("vagrant.docker_installing"))
          @machine.guest.capability(:docker_install)
        end

        if !@machine.guest.capability(:docker_installed)
          raise DockerError, :install_failed
        end

        if @machine.guest.capability?(:docker_configure_vagrant_user)
          @machine.guest.capability(:docker_configure_vagrant_user)
        end

        true
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
vagrant-unbundled-2.3.6.0 plugins/provisioners/docker/installer.rb
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.3.3.0 plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.3.2.0 plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.2.19.0 plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.2.18.0 plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.2.16.0 plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.2.14.0 plugins/provisioners/docker/installer.rb
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.2.10.0 plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.2.9.0 plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.2.8.0 plugins/provisioners/docker/installer.rb