-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker proxy config doesn't work on Ubuntu 15.04 #133
Conversation
Well that totally failed :) I've no idea how to update the tests but I'll give it a go. |
Sorry I'm not sure how to fix this up - it looks like it's failed on a code complexity check rather than the tests as such, and I'm not sure how best to address this. If someone can point me in the right direction it would be appreciated! |
@mrsheepuk Thank you for your trying a pull request!! It is very welcome!! |
@mrsheepuk I cannot reproduce the problem you indicated.. It means no problem for my proxy configuration with Docker on ubuntu/vivid. I did Vagrant and Vagrant-proxyconf version.
My vagrant file [otahi@otahiair vagrant-proxyconf-issue-133]$ cat Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/vivid64"
config.vbguest.auto_update = false
config.vm.provider 'virtualbox' do |v|
v.customize ['modifyvm', :id, '--memory', '256']
end
config.proxy.http = "http://user:[email protected]:8080"
config.proxy.https = "http://user:[email protected]:8080"
config.proxy.no_proxy = "/var/run/docker.sock"
end vagrant reload log
Check proxy related environment variables.
And I checked systemd exists.
|
@otahi Interesting - I'm using an ansible role https://github.com/angstwad/docker.ubuntu which installs the docker-engine package from the official docker repo, instead of the docker.io package from the ubuntu repos. docker-engine is the package which the supported install process for ubuntu (https://docs.docker.com/installation/ubuntulinux/) - i.e. what you get if you run |
@otahi Here's the steps to reproduce:
On the ssh term:
Then do the It's also possible to specify the proxy in a
I don't know how such a file would get created, but it's a very clean way of configuring the proxy as it doesn't involve any assumptions about the current configuration file for the systemd service. |
@mrsheepuk Thank you for your quick response. Now, I understand the installed docker package is different. I found the docker.io package reads I will recheck with your steps. |
/lib/systemd/system/docker.service in Docker's officaial package does not include /etc/default/docker.
@mrsheepuk I have added lib/vagrant-proxyconf/cap/debian/docker_proxy_conf.rb for Docker official package on Debian/Ubuntu. See otahi@b4f8689 on https://github.com/otahi/vagrant-proxyconf/tree/fix_ubuntu_docker. Can you check it? |
I'll check it in a couple of hours time - thanks! |
@otahi Thanks for this - I've just tested and it works fine on 15.04 with the official docker docker package now - however this will also apply to all versions of Debian / Ubuntu rather than just those using systemd (i.e. 15.04 onwards in Ubuntu, not sure about Debian versions but assume a similar situation there). I've just spun up a 15.04 and 14.04 image, installed docker then done a vagrant reload - on 14.04 you now get the following error on the reload:
In my pull request, I was guarding against this using this line:
... although that's not bullet-proof, it should catch the vast majority of cases. |
@mrsheepuk Thank you for your indication. Yes, your are right. I was missing that. I think following matrix should be tested. I am trying to coding and testing to fill this matrix.
|
@mrsheepuk I have implemented and tested partially.
I had misunderstood Ubuntu 14.04 systemd condition, so I changed some description. |
@mrsheepuk I have tested the matrix. And all tests are OK.
|
@otahi Great, thanks - I'll pull in your commits and update the pull request. |
Fix ubuntu docker
Docker proxy config doesn't work on Ubuntu 15.04
@mrsheepuk Thank you so much! I appreciate your pull request! |
@otahi no problem, thanks for doing the actual work to integrate it successfully! |
With the introduction of systemd, an extra step is required to make the proxy configuration work - analogous to the handling used for CoreOS whereby the systemd service unit is updated to pull in the environment from
/etc/default/docker
. I'm not experienced with Ruby so I may have made some large errors here, but this now works on my local environment against a ubuntu/vivid image.