In my code base I’m using Network Path (\abc\files) of Hosted System
But when I’m running the image on docker I’m getting error as Directory not found where the /app/ is coming at the start of directory (/app/\abc\files)
where /app is coming from WORKDIR /app
of DockerFile
Hi
I had tried to mount my drive in container docker run -p 81:81 -e ASPNETCORE_ENVIRONMENT="QA" --name project1 --mount type=bind,source=\\MyServer\MyShare\path\to\file,target=/app project1 :latest
but getting the error
EXTRA string=\\MyServer\MyShare\path\to\file is not a valid Windows path
RUN apk add icu-libs
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
WORKDIR /app
RUN apk add --no-cache tzdata
EXPOSE 80
FROM [mcr.microsoft.com/dotnet/sdk:5.0-alpine](http://mcr.microsoft.com/dotnet/sdk:5.0-alpine) AS build
WORKDIR /src
COPY ["Project/Project.csproj", "Project/"]
RUN dotnet restore "Project/Project.csproj" --source [https://api.nuget.org/v3/index.json](https://api.nuget.org/v3/index.json)
COPY . .
WORKDIR "/src/Project"
RUN dotnet build "Project.csproj" -c Development -o /app/build
FROM build AS publish
RUN dotnet publish "Project.csproj" -c Development -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Project.dll"]```
For image
```docker build -t Project1 -f Project\Dockerfile .```
For Container
```docker run -p 81:81 -e ASPNETCORE_ENVIRONMENT="QA" --name Project1 Project1 :latest```
C# Codebase
```DirectoryInfo watchDirInfo = new DirectoryInfo("\\abc\file$\doc\test");
FileInfo[] fileInfos = watchDirInfo.GetFiles(_filePattern, SearchOption.TopDirectoryOnly);```
Error
``` Could not find a part of the path '/app/\\abc\file$\doc\test'.
at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
at System.IO.Enumeration.FileSystemEnumerator`1.Init()
at System.IO.Enumeration.FileSystemEnumerator`1..ctor(String directory, Boolean isNormalized, EnumerationOptions options)```
where *(\\abc\file$\doc\test)* is a network drive path
So what should i do to mount my network path on the docker container
i had used docker run -p 81:81 -e ASPNETCORE_ENVIRONMENT="QA" --name project1 --mount type=bind,source=\\MyServer\MyShare\path\to\file,target=/app project1 :latest
but it is not recognizing \\MyServer\MyShare\path\to\file as a correct path and giving the error EXTRA string=\\MyServer\MyShare\path\to\file is not a valid Windows path