ContainerProvider icon indicating copy to clipboard operation
ContainerProvider copied to clipboard

Unable to connect from within corporate networks

Open nilleb opened this issue 8 years ago • 11 comments

I work from behind a corporate proxy. Which eventually asks for the user authentication.

How should I use this powershell module in order to download container images through the corporate proxy?

Hint: the httpClient(s) should be initialized via an HttpClientHandler

image

nilleb avatar Apr 28 '16 08:04 nilleb

Hi @nilleb, for your question on msdn forum (https://social.msdn.microsoft.com/Forums/en-US/30e7e8fe-ba48-4f1c-8d75-36b54af502ae/installpackageprovider-no-match-was-found?forum=windowscontainers), can you help us identify the problems by trying out the following commands?

  1. Run “Get-PackageProvider nuget” to see whether he has NuGetProvider
  2. Run “Find-PackageProvider ContainerImage -Verbose”
  3. Run “Find-Module ContainerImage -Verbose”

Thanks,

Quoc

quoctruong avatar Apr 29 '16 22:04 quoctruong

I'll give you the desired information on Monday.

But, let's not mix the two problems, please. (I say this because the problems affect two different tools, and because you're asking more details about a problem in the msdn forums, via a possibly unrelated issue in github)

nilleb avatar Apr 30 '16 12:04 nilleb

Ciao Quoc,

I have added the details you asked on the MSDN question (https://social.msdn.microsoft.com/Forums/en-US/30e7e8fe-ba48-4f1c-8d75-36b54af502ae/installpackageprovider-no-match-was-found?forum=windowscontainers).

By the way, which is the officially recommended procedure to set the proxy on a Windows Server Core without Desktop Experience? And for Windows Server Nano?

Thanks for your attention, Ivo

nilleb avatar May 02 '16 07:05 nilleb

I have found a workaround for the question on the MSDN forums. Have a look at the MSDN forums to see how to workaround this issue.

But, this issue persists, BECAUSE these scripts won't work if the system proxy asks for the user authentication. Sadly, this is the case of almost all the tools provided by Microsoft in the last year..

nilleb avatar May 02 '16 07:05 nilleb

Hi @nilleb, for the authentication proxy issue for "install-packageprovider": we have a planned work item for adding support for proxy with authentication in OneGet and PowerShellGet so hopefully that would solve this problem.

As for the authentication proxy issue for "install-containerimage": we are not using the httpclient to download so the fix suggested won't solve it (unless you are using the older version of ContainerImage which uses HttpClient on NanoServer). However, we will look into adding support for authentication proxy in future release of container images.

quoctruong avatar May 02 '16 16:05 quoctruong

Hi @quoctruong ,

I'm happy to hear that you will soon support authenticated proxies in "install-packageprovider" and in "install-containerimage".

You are surely right when you say that the psm1 doesn't use httpClient to _download _the file. Yet, it uses an $httpClient to get the file length and to resolve the FwkLink (it means, as I read the code, that it uses an httpclient to get the URI to download the images from. specifically, these download links are the ones I've mentioned in my MSDN question).

Have a good evening, nilleb

nilleb avatar May 02 '16 19:05 nilleb

By the way, @quoctruong , may I ask you what do you think about a solution like https://github.com/nilleb/authentication-proxy ? That's just a little workaround, but it has helped me in our environment.

nilleb avatar May 02 '16 19:05 nilleb

@nilleb Apologies that you are facing these issues. We have a work item on our end to get this resolved soon. However, in the meanwhile, you can unblock yourself by using the Start-BitsTransfer with its Proxy parameters to get around this. To download the WindowsServer Container image, please use this URI: https://az887518.vo.msecnd.net/pshctcontainer/WindowsServerCore-10-0-14300-1000.wim Feel free to ping us if you face any other issues.

HTH! Thanks for your patience.

Cheers, Jay!

jayshah-msft avatar May 02 '16 23:05 jayshah-msft

Any news about this? I have the same problem with our corporate proxy :-/

luisgf avatar May 31 '16 09:05 luisgf

Hi @luisgf, we are fixing the issue for the next release of ContainerImage provider. Please stay tune!

quoctruong avatar Jun 02 '16 16:06 quoctruong

Hey guys,

I was able to work around this issue by manually downloading the .Wim file to the C: drive: https://az887518.vo.msecnd.net/pshctcontainer/WindowsServerCore-10-0-14300-1000.wim

Then instead of calling Install-ContainerImage, use:

Install-ContainerOSImage -WimPath c:\WindowsServerCore-10-0-14300-1000.wim

That process will take awhile but then just Restart-Service docker and the image should show up running docker images command.

If you call Install-ContainerImage with -Verbose command and go into the .psm1 file it will lead you to the above call.

rbj325 avatar Jun 09 '16 19:06 rbj325