When using dockerfile and dockercompose, how can I map a network drive letter?

53 Views Asked by At

I have an ASP.NET Core application running in a Windows container. I need to ensure that the ASP.NET Core application can access a network path like G:\public.

I have a Docker file and a compose file which I run docker-compose up -d

The Dockerfile looks like this:

FROM mcr.microsoft.com/dotnet/aspnet:8.0.0-windowsservercore-ltsc2022
WORKDIR /App
ENTRYPOINT ["MyApp.exe"]
ENV ASPNETCORE_ENVIRONMENT=Production

How do I map the network path to a drive letter inside to the container? For example, using the net use command. Should it be part of the entrypoint?

0

There are 0 best solutions below