Docker Community Forums

Share and learn in the Docker community.

Docker WORKDIR / app causing issues with folder path - ASP .Net Core Application

Hi All,

So I have a .Net Core Web Application running on Linux Centos 7.6 server, within a docker container.

Docker version 18.09.4

My application code is in the path /var/myapplication

My web application uploads files to the myapplication/wwwroot directory. This works locally on my machine. However on the server, the files don’t appear to be saved to the wwwroot folder. Looking at the filepath that the file is going to on the server, the files are being saved to /app/wwwroot/<filename.xyz>

However, this is no app folder in my application on the server. I believe this is coming from my docker file which contains the line WORKDIR /app

I have tried to amend this to

WORKDIR /

but then the container fails during the build stage.

Any ideas would be appreciated,

Thanks