-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Possible issue with "VS Tools for Docker" when there's a network proxy to access Docker Hub #224
Description
Looks like VS Tools for Docker can have issues when there's a network proxy in between the dev machine and Docker Hub.
However, the Docker CLI, just by using "docker pull" looks like that works ok.
so the issue might be just related to VS Tools for Docker?
Original thread from:
#107 (comment)
sg1970 commented 22 hours ago • edited
This is just not proxy aware un-fortunately like most tech comming out these days making me wonder if Iam the only one that works behind a proxy !!! The project builds fine but wont run when I hit F5 as it runs into a proxy error. I get the error (see below) on the Docker Compose project.
I tried these things :
Set Proxy credentials on the docker settings
set http_proxy and https_proxy env variables.
And finally out of desperation tried this as well --> https://stackoverflow.com/a/12634725
But no joy so far!
I suspect I need to edit Dockerfile or docker-compose.yaml files to pass proxy creds in clear text ?
--- Error Details ---
The remote server returned an error: (407) Proxy Authentication Required
Severity Code Description Project File Line Suppression State Error MSB4018 The "EnsureVsDbgExists" task failed unexpectedly. System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required. at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar) --- End of inner exception stack trace --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.DotNet.Docker.BuildTasks.VsDbgHelper.<>c__DisplayClass3_0.<b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.DotNet.Docker.BuildTasks.VsDbgHelper.d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.DotNet.Docker.BuildTasks.DockerBaseTask.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() docker-compose C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0\Docker\Microsoft.VisualStudio.Docker.Compose.targets 185
@CESARDELATORRE
Owner
CESARDELATORRE commented 5 hours ago
@sg1970 This is related to your Docker environment configuration since you need to use a proxy.
Basically, you need to have access to https://hub.docker.com/ in order to pull/download the base Docker images.
You can try to manually pull/download the base images you see on every dockerfile, or the infrastructure containers, like running the following Docker CLI commands from the command prompt (once Docker is installed):
docker pull microsoft/aspnetcore:1.1.2
docker pull microsoft/mssql-server-linux
docker pull mongo
docker pull redis
docker pull rabbitmq
Here's some info about it, from Docker:
Proxy configuration
If you are behind an HTTP proxy server, for example in corporate settings, before open a connect to registry, you may need to configure the Docker daemon’s proxy settings, using the HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables. To set these environment variables on a host using systemd, refer to the control and configure Docker with systemd for variables configuration.
Also, see this thread at stackoverflow
https://stackoverflow.com/questions/23111631/cannot-download-docker-images-behind-a-proxy
I cannot test it because we don't use any traditional proxy in MSFT Corpnet.
In any case, you are experiencing a Docker environment problem, so please, research in Docker's sites, as Docker CLI does support to work with proxies, ok?
Thank you.
@sg1970
sg1970 commented 24 minutes ago • edited
@CESARDELATORRE Thanks for the quick response. Greatly appreciate that !
I have access to docker hub (thru the same corporate proxy)
I can manually download the images from command prompt (see logs below)
So I was able to successfully pull all Docker images you listed
But still stuck with the same Proxy ... It just wont run thru Visual Studio !
I realize that it has nothing to do with your code (Works from home) but something to think about.
---Manual Docker Pull ---
C:>docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
d4w/nsenter latest 9e4f13a0901e 9 months ago 83.8 kB
C:>docker pull microsoft/aspnetcore:1.1.2
1.1.2: Pulling from microsoft/aspnetcore
9f0706ba7422: Pull complete
8c906b05891b: Pull complete
7378286116c1: Pull complete
6c5e797d4ef1: Pull complete
b660c1be1245: Pull complete
Digest: sha256:8dc2cad5c561aaf44fdc963f5cd8ac36e53b52dae595a50b4212930cca533b5a
Status: Downloaded newer image for microsoft/aspnetcore:1.1.2
C:>docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
microsoft/aspnetcore 1.1.2 7a07a406c6af About an hour ago 305 MB
d4w/nsenter latest 9e4f13a0901e 9 months ago 83.8 kB
C:>
@CESARDELATORRE
Owner
CESARDELATORRE commented 3 minutes ago
@sg1970 Interesting... If it is about Visual Studio and not really about Docker CLI, I'll ping the VS Docker Tools team guys. What is your email? Please, send me an email to CESARDL at Microsoft.com so I copy you into the thread I'll open with the VS Docker Tools team guys.