tmatilai / vagrant-proxyconf

Vagrant plugin that configures the virtual machine to use proxies
MIT License
531 stars 74 forks source link

vagrant 1.6.5+ docker 1.6.1 on Debian Testing does not seem to work #125

Closed rahul-amaram-vizury closed 9 years ago

rahul-amaram-vizury commented 9 years ago

Here is the configuration:

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  # All Vagrant configuration is done here. The most common configuration
  # options are documented and commented below. For a complete reference,
  # please see the online documentation at vagrantup.com.

  config.proxy.http     = "http://172.17.42.1:3128/"
  config.proxy.https    = "http://172.17.42.1:3128/"
  config.proxy.ftp      = "http://172.17.42.1:3128/"
  config.proxy.no_proxy = "localhost,127.0.0.1"
  ...
  ...
  ...
  config.vm.provider "docker" do |d|
    d.build_dir = "vagrant"
    d.has_ssh = true
  end
  ...
  ...
  ...
end

Is anything else needed? When I run vagrant using --debug , it shows that the proxyconf plugin got loaded. However, the proxy configuration does not seem to be used by docker. I believe I also restarted docker though I am not sure if this is really needed.

mrsheepuk commented 9 years ago

I think this is caused by needing to set the proxy config in /etc/systemd/system/docker.service.d/http-proxy.conf on the newer deb/ubuntu versions which use systemd instead of upstart.

I've managed to get docker respecting the proxy by manually adding that file with content like:

[Service] 
Environment="HTTP_PROXY=http://10.0.0.10:8080/" "HTTPS_PROXY=http://10.0.0.10:8080/"

... however I don't know Ruby so my attempts to update vagrant-proxyconf to push this out have been unsuccessful so far.

mrsheepuk commented 9 years ago

I've made a pull request #133 which may address this, it works for me but as I say I'm not an experienced Ruby person so I may have made some fundamental errors in it!

otahi commented 9 years ago

@rahul-amaram-vizury I am sorry, I could not respond. Please tell me the Debian version. @mrsheepuk Thank you for reminding me, I will check it later.

rahul-amaram-vizury commented 9 years ago

I don't remember the complete context for this ticket as it has been a long time. I am currently using Debian Testing (stretch). I think I had implemented some workaround for this problem but I'm sorry I cannot recollect it now.

otahi commented 9 years ago

OK. Ubuntu/Debian Docker official package issue is discussed on #133. So I have closed this issue.

ghost commented 6 years ago

Is this resolved because having ubuntu 18.04 as guest i still have to manually change it like here: https://docs.docker.com/config/daemon/systemd/#httphttps-proxy