Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set proxy in docker toolbox?

I have just installed docker toolbox on windows environnement (Windows 7 Pro) and I have got a network time out due to the entreprise proxy. How can I set the proxy in docker toolbox ?

Thanks for your help.

like image 710
Corinne Kubler Avatar asked Apr 25 '16 14:04

Corinne Kubler


People also ask

Does docker use system proxy?

In Docker 17.07 and higher, you can configure the Docker client to pass proxy information to containers automatically. In Docker 17.06 and earlier versions, you must set the appropriate environment variables within the container.

What is docker proxy program?

docker-proxify is a docker-within-docker container that eases development when operating behind a restrictive firewall that requires a proxy server for outbound internet connectivity, by making the use of the proxy server transparent to the applications running inside the container.

What is a proxy container?

Introduction. ContainerProxy is an application that launches and manages containers for users, to perform specific tasks. Examples include: Run interactive Shiny apps. Execute long-running R jobs.


3 Answers

I encountered the same problem. Here is my solution.

Env:

Win7, Docker Toolbox 17.03, cmder terminal, behind enterprise proxy setting.

Solution:

in C:\Program Files\Docker Toolbox, find start.sh file. add following two proxy settings:

export http_proxy="http://hostname:port/"
export https_proxy="http://hostname:port/"

At least, it works for me.

like image 142
ShuSon Avatar answered Oct 17 '22 03:10

ShuSon


I have a similar problem for Windows 7 but it was resolved by these steps :

  • Step 1. Create a batch script C:\Program Files\Docker Toolbox\kitematic_proxy.cmd with below configuration

    set proxy=YOUR_PROXY
    SET HTTP_PROXY=%proxy%
    SET HTTPS_PROXY=%proxy% 
    for /f %%i in ('docker-machine.exe ip default') do set DOCKER_HOST=%%i
    SET NO_PROXY=%DOCKER_HOST%
    set DOCKER_HOST=tcp://%DOCKER_HOST%:2376
    cd Kitematic
    Kitematic.exe
    
  • Step 2. Open Oracle Virtual machine from the start menu , go to command prompt by clicking Show (Make sure your Oracle Vm is up and running)

enter image description here

enter sudo vi /var/lib/boot2docker/profile

add this lines

export HTTP_PROXY=http://your.proxy.name:8080
export HTTPS_PROXY=http://your.proxy.name:8080

use your proxy address & port

this link help me a lot https://github.com/docker/kitematic/wiki/Common-Proxy-Issues-&-Fixes

Note:

  1. Don't forget to add 192.168.99.100 ip to your proxy setting's exception list (use inetcpl.cpl )
  2. Don't forget to add HTTP_PROXY and HTTPS_PROXY to your user variable (Advance settings->Environment variables)
  3. Don't forget to restart your pc
like image 27
mnhmilu Avatar answered Oct 17 '22 03:10

mnhmilu


Installing docker on windows 7 (docker 18.09.0) behind an enterprise proxy was quite complicated for me. Here are the steps I followed:

  1. set HTTP_PROXY variable in your windows environment (HTTP_PROXY=http://your_proxy:port)
  2. install docker toolbox with installer or run in powershell as admin: choco install docker-toolbox (Warning! Don't use Docker for windows, as it targets Windows 10)
  3. ensure you don't have any previous VM created by your previous attempts ( docker-machine ls should be empty. If not run: docker-machine rm default)
  4. run in powershell as user: docker-machine --native-ssh create -d virtualbox --engine-env HTTP_PROXY=$HTTP_PROXY --engine-env HTTPS_PROXY=$HTTPS_PROXY default.
  5. run C:\Program Files\Docker Toolbox\start.sh
  6. Now run docker pull busybox. This should work.
like image 3
Mapad Avatar answered Oct 17 '22 03:10

Mapad