I have the following simple app
var fileCount = System.IO.Directory.GetFiles(@"/home/joe").Count();
Console.WriteLine($"Hello,! There are {fileCount} files.-");
And a dockerfile
FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY . ./
RUN dotnet publish HelloDocker -c Release -o publish
FROM base AS final
COPY --from=build src/publish .
ENTRYPOINT ["dotnet", "HelloDocker.dll"]
I am attempting to run this with variations of the following command based on search results.
docker run -i test:nobase -v c:/temp:/home/joe
but keep getting a System.IO.DirectoryNotFoundException saying that Could not find a part of the path '/home/joe'.
How should the correct path to c:\temp be shared and accessed from my app when running in a container?