Docker with App_Data volume?

Viewed 774

I'm trying out Docker on a Synology with .NET Core, but I'm having some issue with disk access.

In my ASP.NET Core app I build and persist some data during the app-Startup if not existing allready. But when running the app in Docker and requesting it from a browser I don't get any data in this folders, so I suspect that the folder is not found or is not accessible.

How do I setup my Docker Image to find and have access to this folder? What account is a Docker request thread executing with? Do I have to add read/write access for this account to this folder manually? I have mounted a volume but I'm not sure what to enter for the mount path? Is this correct?

/docker/mywebapp/App_Data /App_Data

Is it a problem that source dir is inside the docker-image-path itself?

Update

The problem was not really with disk access. I had some code that depended on being able to check if the request ip was local and Docker is using another private network ip-range so I had to fix that first.

But now when running the app, which is working and apparently saving data, I don't get where the files are saved? The folder I pointed to, my App_Data-folder, is still empty. Are the files stored elsewhere? And it seem to work fine even without a mounted Docker Volume. How is that possible?

0 Answers
Related