I have Docker for Windows running on a corporate network with the proxy which is correctly configured in the Docker settings. In a directory with a simple Dockerfile, I am able to use
docker build -t buildtest .
to build an image. This confirms the proxy is correctly configured within Docker.
When I add a docker-compose.yml file and try to do the build there, it does fails and shows the error that comes from the proxy server. It doesn’t appear to be applying the proxy settings for the build process via Docker Compose.
Setting the build args in the docker-compose.yml file does not seem to help either (that was how I used to do it with Docker Toolbox, but should probably not be necessary).
Expected behavior
I expect the following to build the image defined in the docker-compose.yml file
docker-compose build buildtest
Actual behavior
When I try to build, I get the following output
docker-compose build
Building testservice
ERROR: <HTML><HEAD>`
<TITLE>Access Denied</TITLE>
...
Additional, proxy specific output saying the proxy failed to authenticate
(omitted for brevity)
...
</BODY></HTML>
Information
Running Docker Version 1.12.0-rc4-beta20 (build: 5579) 4b0b82c
Steps to reproduce the behavior
On a machine where a corporate proxy is required, create a new directory
+1 - This is a fairly big issue for me. My team’s build server sits in AWS under a different network topology from the corporate office network. The proxy settings aren’t needed in AWS, but if I pull down the code to run locally I cannot docker-compose build without manual intervention. Without this feature, portability, and especially corporate development, are significantly hindered.
Was there any solution for this problem. I am still facing issues while doing compose build. Image builds successfully with docker build. please find the command and error below
compose.config.config.find: Using configuration files: C:\local\docker-compose.yml
docker.auth.find_config_file: Trying paths: ['C:\\Users\\admin\\.docker\\config.json', 'C:\\Users\\admin\\.dockercfg']
docker.auth.find_config_file: No config file found
Traceback (most recent call last):
File "docker-compose", line 6, in <module>
File "compose\cli\main.py", line 68, in main
File "compose\cli\main.py", line 118, in perform_command
File "compose\cli\command.py", line 37, in project_from_options
File "compose\cli\command.py", line 99, in get_project
File "compose\cli\command.py", line 74, in get_client
File "site-packages\docker\api\daemon.py", line 177, in version
File "site-packages\docker\utils\decorators.py", line 46, in inner
File "site-packages\docker\api\client.py", line 189, in _get
File "site-packages\requests\sessions.py", line 488, in get
File "site-packages\requests\sessions.py", line 475, in request
File "site-packages\requests\sessions.py", line 617, in send
File "site-packages\requests\sessions.py", line 177, in resolve_redirects
File "site-packages\requests\sessions.py", line 596, in send
File "site-packages\requests\adapters.py", line 499, in send
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='proxy.mydomain.com', port=8080): Read timed out. (read timeout=60)
Failed to execute script docker-compose