Sha256: d05d3c5940b93ae3aedbacbfc735311cbc0b247d0e0a1d7fadb70f38f9d0fec5

Contents?: true

Size: 1.12 KB

Versions: 30

Compression:

Stored size: 1.12 KB

Contents

module VagrantPlugins
  module DockerProvisioner
    class Installer
      def initialize(machine)
        @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.
      # @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

30 entries across 26 versions & 4 rubygems

Version Path
vagrant-unbundled-2.2.7.0 plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.2.6.2 plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.2.6.1 plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.2.6.0 plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.2.5.0 plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.2.4.0 plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.2.3.0 plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.2.2.0 plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.2.0.0 plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.1.4.0 plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.1.2.0 plugins/provisioners/docker/installer.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/plugins/provisioners/docker/installer.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/plugins/provisioners/docker/installer.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/plugins/provisioners/docker/installer.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/plugins/provisioners/docker/installer.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/plugins/provisioners/docker/installer.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.1.1.0 plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.0.4.0 plugins/provisioners/docker/installer.rb
vagrant-unbundled-2.0.3.0 plugins/provisioners/docker/installer.rb