Not able to access network path from within the container

I am trying to “dir” a UNC path from within the “cmd” command that I invoked as follows

docker run -it python cmd

From within the container, I am trying to dir the UNC path like this :

dir \\\path

This is the error that I get when I try to map to a drive

C:\>net use * \\\path
System error 64 has occurred.

The specified network name is no longer available.

I also ensured that I am able to ping the server

Expected behavior

I should be able to see files and folders in that location with the dir command and
should be able to map a network location to a drive letter with the net use command

Actual behavior

The cmd keeps running. The command window just staring at me with the blinker that goes on blinking


Docker version (both server and client) : 18.03.1-ee-5
Api version 1.37

Steps to reproduce the behavior

Shown above

First verify if remote server is available, that is that name is resolve and you can ping it and then you shall be providing username/password to authenticate which I don’t see you are doing.

I have a application to read files from network path and upload it. When I try this workflow from windows container, I am getting “Access to the path ‘\servername\sharepath’ is denied” exception. Can you help me how to access network path from ASP.Net MVC application (C# programming) on the container environment? Sample docker file will be more helpful.