Sha256: 6ca1e4fcebcabf0a1c373310539f856c5c5e7902e7c16a976a3570203c0fe11c

Contents?: true

Size: 1.28 KB

Versions: 12

Compression:

Stored size: 1.28 KB

Contents

module VagrantPlugins
  module DockerProvisioner
    module Cap
      module Centos
        module DockerInstall
          def self.docker_install(machine)
            machine.communicate.tap do |comm|
              comm.sudo("yum -q -y update")
              comm.sudo("yum -q -y remove docker-io* || true")
              comm.sudo("yum install -y -q yum-utils")
              comm.sudo("yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo")
              comm.sudo("yum makecache")
              comm.sudo("yum install -y -q docker-ce")
            end

            case machine.guest.capability("flavor")
            when :centos
              docker_enable_service(machine)
            else
              docker_enable_systemctl(machine)
            end
          end

          def self.docker_enable_systemctl(machine)
            machine.communicate.tap do |comm|
              comm.sudo("systemctl start docker.service")
              comm.sudo("systemctl enable docker.service")
            end
          end

          def self.docker_enable_service(machine)
            machine.communicate.tap do |comm|
              comm.sudo("service docker start")
              comm.sudo("chkconfig docker on")
            end
          end
        end
      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/cap/centos/docker_install.rb
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/plugins/provisioners/docker/cap/centos/docker_install.rb
vagrant-unbundled-2.3.3.0 plugins/provisioners/docker/cap/centos/docker_install.rb
vagrant-unbundled-2.3.2.0 plugins/provisioners/docker/cap/centos/docker_install.rb
vagrant-unbundled-2.2.19.0 plugins/provisioners/docker/cap/centos/docker_install.rb
vagrant-unbundled-2.2.18.0 plugins/provisioners/docker/cap/centos/docker_install.rb
vagrant-unbundled-2.2.16.0 plugins/provisioners/docker/cap/centos/docker_install.rb
vagrant-unbundled-2.2.14.0 plugins/provisioners/docker/cap/centos/docker_install.rb
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/plugins/provisioners/docker/cap/centos/docker_install.rb
vagrant-unbundled-2.2.10.0 plugins/provisioners/docker/cap/centos/docker_install.rb
vagrant-unbundled-2.2.9.0 plugins/provisioners/docker/cap/centos/docker_install.rb
vagrant-unbundled-2.2.8.0 plugins/provisioners/docker/cap/centos/docker_install.rb