-
Notifications
You must be signed in to change notification settings - Fork 1.2k
how to set proxy in docker toolbox? #102
Comments
The best is the docker machine's document. I fix this issue with this:
|
@SydOps Thanks for willing to help with the solution as well. cc/ @nathanleclaire from the machine team. |
So @SydOps does the |
Mostly. I have to create two docker machines (one is call So depend on where I am, I need switch I didn't have chance to test with swarm, but if you'd like provide the full command how Toolbox creates the |
Second,
It may fix this issue. Will be back to confirm soon. |
I did the test, add above proxy setting into Do the same in default (proxy enable when create), remove the proxy setting from above So I have to create the machine with proxy setting from beginning if I need docker machine works behind proxy, the old way to do within profile in boot2docker is useless in docker machine. IT is a solution, but it is bad solution, I have to maintain two machines and download duplicate images in each docker machine |
Merging with #78 |
Hi, I have the same issue on my Windows PC ; moreover, my proxy requires credentials which are not permanent. So even if I hack the start.sh script for creating the default machine, I'll need to be able to update credentials every 56 days. Is there a way to update those env settings ? Thanks, |
@nsteinmetz I just set a variable in my ~/.bashrc, and then set all the different proxies to that variable:
From within the You could also create a script that just changes the MyProxy value whenever your password changes, and then put that script on your path. |
@LongLiveCHIEF: I'm not sure to understand ; you mean the .bashrc of the "Docker Terminal" in Windows ? I added the export http_proxy stuff in the start.sh script but seems it did not work even if you see it in the output of the "env" command in the terminal. Maybe because I added my password as plain text and not as url encoded (but it worked this way on some other linux box) Edit:
So for me, the only working solution is the one of @SydOps mentionned above:
|
If you're getting "Proxy Authentication" errors when your proxy doesn't require credentials, try adding a trailing slash to your proxy variables, as in:
It seems that |
I had the same issue - I downloaded Docker Toolbox today (Sep 23, 2015) so this is not fixed. My toolbox install succeeded but I was not able to run even the hello-world example because docker-machine did not have the proxy settings, so I would get a network timeout. The only thing that worked for me was the suggestion above of using --engine-env (thank you so much @SydOps and others).
Other things I tried that did NOT work for my situation:
|
@desagar Any suggestion on how we might be able to do this automatically for you on first Toolbox installation / Machine create? Specifically, it would be hard for us to detect a proxy or VPN automatically, so I'm wondering if we might be able to prompt for the right values, etc. |
@nathanleclaire I agree that asking for this information during Toolbox installation would be very helpful, although it would be nice to also have some way to modify this on a previously created docker-machine, either by editing a file or invoking some docker-machine command. |
Another nice way would be to rely on / inherit from the system properties to avoid an extra declaration. |
Agree about the system properties, but an option to edit during Toolbox install would be still be good. In my system property settings I don't specify the proxies and the no_proxy explicitly but use an auto config URL, so there would be nothing to inherit |
I just find another way which only need one docker machine to work behind proxy and without proxy. The key file is: So I have two: if I need start behind proxy, I run:
If I need start without proxy, I run:
You can script it with less typing. Let me know if this works. |
Seems it does not work on W7 with Docker Toolbox 1.8.2c ; As I installed/uninstalled many times docker-toolbox, maybe my PC is a little bit messy too. |
Thanks for the updating, i did the test in Mac only. |
I know this may not be what everyone wants to hear... but I've found a better way for dealing with my problems on this matter. After installing docker toolbox, I went and installed Vagrant, and then ran instead of using I have a sample of how I set things up here: https://github.com/HackerHappyHour/docker-toolbox-vagrant |
@H3Chief Thanks for your instructions. While I install Vagrant, you seemed to have missed adding the Docker sample Vagrantfile to your root on the GIT repo. PS: Appreciate your effort in putting together the HOW-TO. |
@SydOps could you please remind where the Got it:
So unless I made a typo in the syntax, seems it does not work on my W7 PC with Docker 1.8.3 behind a proxy :-/ |
@H3Chief , I agree with @mskadu the vagrant sample file you are mentionning is not in your github repo. Could you please share it ? |
You did the right, but I test in Mac. To all and Docker developer, I still prefer the old boot2docker way and update the profile file |
Hi, where could I find details about using the ~/.docker/machine/machines/myvmname/config.json file. How should be used this file? Edit: I finally did open a specific issue about the config.json file usage : #491 |
hi, i define new proxy on docker 1.11.2 in mac
but get below error during docker pull elasticsearch
where is my setting wrong? please help thanks |
can you login the docker machine (default machine is named
|
@SydOps i test it get result like below:
but ping ip working |
The problem is mostly related to firewall setting in your environment and suitable to discuss at https://forums.docker.com, more than here. Please raise ticket to docker forum. |
in my case, restarting the docker daemon with the proxy set in the environment resolved the issue:
|
Which version? If it is latest, seems the problem has been fixed |
i use 1.11.2 toolbox. it's for me still not working , how to setting proxy for docker still confused me. each time resettings and restart docker is too complicated. any ideas? |
If you are mac or windows user, apply for native docker for mac or windows, I needn't care of the proxy setting now. And it get updated frequently. |
@SydOps But what about for those of us who don't have Windows 10, which seems to be the only Windows version supported by Native Docker. At least within our corporate environment, we just moved to Win 7 a couple years ago, so I don't think we'll be upgrading to Windows 10 in the near future. I guess our only option is to wait until Windows 7 became supported or struggle with the toolbox or I guess just run docker within our own VM. |
@SydOps i'm using docker-machine on Windows 7. |
So what's the way for docker toolbox on windows 7 to use --registry-mirror ? |
@tjlee if you create machine yourself using |
Before native docker, I create two docker-machines, one with proxy setting and one with non-proxy. So I have to duplicate the tasks to pull image or run container, if I need test the same stuff. |
We need to set no_proxy to the docker-machine client.
|
@kujiy You can use |
@nathanleclaire It does not work automatically on my machine(latest toolbox on windows 8.1) but thanks! |
Make sure you're using the latest available version. If not I'd be curious why it's not working. |
Hi!, Split from windows command directory to linux with the following command: $ docker-machine ssh default Write sudo ..... as the following line Write "i" to pass in insert mode and return button. Digit esc ": wq!" to save the new line and verify if everithing is ok with the cat command Restart the daemon Now i have restarted the Docker toolbox and the "Docker pull image_name" work fine! Thanks a lot to everybody! |
recommend to use |
If you are using windows go to docker toolbox folder edit start.sh and start.cmd export HTTP_PROXY=http://YOURPROXYSERVER |
Whiles this may allow for the proxy to function, now imagine that your
proxy credentials are tied to Active Directory/LDAD which will change every
30 or 90 days.
It won't be advisable to store user credentials within a configuration file
such as this but rather supported by natively using the OS proxy which is
already configured via Kerberos, NTLM or some other means, or at the very
basic once Docker is executed on the system if the user indicates that a
proxy is present it could prompt the user for proxy credentials so that
they are stored within memory rather than hard coded into a file
…On Sat, Jan 14, 2017 at 11:42 PM nbulusanjr ***@***.***> wrote:
If you are using windows go to docker toolbox edit start.sh
Add this line after line 82
export HTTP_PROXY=http://YOURPROXYSERVER
export HTTPS_PROXY=http://YOURPROXYSERVER
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#102 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACsR6E-n6Cxxephsx0BgjgD9s_xJziYuks5rSaPDgaJpZM4FshFj>
.
|
@nbulusanjr I think that line # may have changed. Right now that line is in the middle of an ASCII graphic. Might be better to put it after this:
However that didn't fix the issue that I'm having ("wsarecv: An existing connection was forcibly closed by the remote host.") |
@nbulusanjr : Adding the EXPORT calls after Line 82 fixed the issue for me. Thanks! |
On Windows7, using toolbox behind a corp proxy. Here's how to do, very simple and for beginners like me:
All of this is probably somewhere on this and other pages, but it wasn't clear to me where to launch commands: in docker quickstart terminal, in some VM, in Windows cmd... so here I'm writing it down step by step. I realize that I'm falling into the same issue as was reported here in 08/2015, two years ago. Means using 2 different machines for docker tools, depending on whether I'm behind a proxy or not. But hey it's better than nothing. |
@ozbillwang |
@ozbillwang |
Anybody still having this issue on Windows with Docker Toolbox and command line tools, this is what worked for me: use Kitematic, set proxy for it as described here: https://github.com/docker/kitematic/wiki/Common-Proxy-Issues-&-Fixes after that start the Docker CLI from Kitematic. All proxy settings are inherited inside that shall, so command line tools will work, even if you have a proxy that requires authentication. |
@lgathy That page is golden! Thanks for linking it managed to fix it in all environments! |
Hi all, I am facing the same problem mentioned above and have read and tried each comment - this page covers almost all the solutions found in the internet. Can anyone help, heres all that I did: I'm on windows 7 behind a corporate proxy that needs authentication.
Error: If I disconnect from VPN, it works immediately. |
I can
boot2docker ssh
to set proxy, but i don't know how to set proxy in toolbox to pull the image.Anyone gives hints?
The text was updated successfully, but these errors were encountered: