Sha256: d08ceea4c3fd3ac18aaa9452928a8ca4e99ce49bbad22342588a2084914a9c00

Contents?: true

Size: 1.35 KB

Versions: 1

Compression:

Stored size: 1.35 KB

Contents

module VagrantPlugins
  module DockerProvisioner
    module Cap
      module Debian
        module DockerInstall
          def self.docker_install(machine, version)
            package = 'lxc-docker'
            package << "-#{version}" if version != :latest

            machine.communicate.tap do |comm|
              comm.sudo("apt-get update -y")
              # TODO: Perform check on the host machine if aufs is installed and using LXC
              if machine.provider_name != :lxc
                comm.sudo("lsmod | grep aufs || modprobe aufs || apt-get install -y linux-image-extra-`uname -r`")
              end
              comm.sudo("apt-get install -y --force-yes -q curl")
              comm.sudo("curl -sSL https://get.docker.com/gpg | apt-key add -")
              comm.sudo("echo deb https://get.docker.com/ubuntu docker main > /etc/apt/sources.list.d/docker.list")
              comm.sudo("apt-get update")
              comm.sudo("echo lxc lxc/directory string /var/lib/lxc | debconf-set-selections")
              comm.sudo("apt-get install -y --force-yes -q xz-utils #{package} -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold'")

              # chmod the directory if it exists
              comm.sudo("chmod 0755 /var/lib/docker")
            end
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-cloudstack-1.2.0 vendor/bundle/bundler/gems/vagrant-c84e05fd063f/plugins/provisioners/docker/cap/debian/docker_install.rb