Module: VagrantPlugins::ProxyConf::Cap::Linux::DockerProxyConf

Defined in:
lib/vagrant-proxyconf/cap/linux/docker_proxy_conf.rb

Overview

Capability for docker proxy configuration

Class Method Summary collapse

Class Method Details

.docker_proxy_conf(machine) ⇒ String, false

Returns the path to docker or ‘false` if not found.

Returns:

  • (String, false)

    the path to docker or ‘false` if not found



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/vagrant-proxyconf/cap/linux/docker_proxy_conf.rb', line 10

def self.docker_proxy_conf(machine)
  docker_command = 'docker'    if Util.which(machine, 'docker')
  docker_command = 'docker.io' if Util.which(machine, 'docker.io')

  return false if docker_command.nil?

  if machine.communicate.test('cat /etc/redhat-release')
    "/etc/sysconfig/#{docker_command}"
  elsif machine.communicate.test('ls /var/lib/boot2docker/')
    "/var/lib/boot2docker/profile"
  else
    "/etc/default/#{docker_command}"
  end
end