Docker Community Forums

Share and learn in the Docker community.

Multistaged build

i have a multistaged dockerfile it is a c# .net core application with imagemagick. https://aka.ms/containerfastmode that’s the link to the documentation of how the app is built with visual studio. the only thing is according to multistaged build documentation only what i copy from previous stages should be present in the final image. But when i go into the container the src folder from the 2end stage is present but it shouldn’t are there any common mistakes that cause this?
The dockerfile is not attached since I cannot add an attachment and I removed the download links from the file but when I press create topic it still says there are more then 2 links in my post even though there is only 1 so image it is because for some reason that does work. What i also find weird is that visual studio makes it possible to copy folders from a higher directory then the dockerfile because the globals and logic you see are on the same layer of the console interface folder and the docker file is inside of the console interface folder since this is how visual studio creates this file when you add docker support.
The vary last copy is one i added myself since i need those resources but those won’t get added unless i put them inside the console interface folder, i think they then get added by the copy . . But if I then run it with a docker compose everything is good for the stages the scr folder is not there anymore it’s so odd. All the copy’s you see are also converted to mount when I go into the container because when I change folder on my host they change in the container even though this shouldn’t be the case but visual studio probably does it like this since the folders it copy’s are on a higher layer the dockerfile.
Thank you for your time!