Open amcasey opened 7 months ago
@amcasey the paths being relative to the solution isn't a bug in itself. But if it isn't building properly with those then it is a bug.
@LukasKubicek looking at your example I think I might have an idea what is going wrong.
By default, we scaffold paths relative to the solution not the project as intended. With that we imply the build context is ..
. In your project did you have <DockerfileContext>.</DockerfileContext>
set and manually change those dockerfile paths in 7.0? We don't handle scaffolding with a context set very well.
I am on 17.8.5 with .Net 8.0.1. I had to add <DockerfileContext>..</DockerfileContext>
to my pubxml and this solved the problem for me.
@amammes It is not recommended to set DockerfileContext
in your pubxml, that should be set in the main project.
@amcasey I just checked, the fix for scaffolding with DockerfileContext
already set is available in 17.9.0 Preview 3.0
I used these steps as well and when running docker build
from the project folder it fails.
When running docker build -f <FOLDER>/dockerfile
from the solution
location it works.
Expected: paths are relative to the folder containing the dockerfile (i.e. the project folder). Actual: paths are relative to the parent folder (i.e. the solution folder).
Was https://github.com/dotnet/aspnetcore/issues/52092
I'm on
17.9.0 Preview 2.0 [34305.10.main]
, but the OP was on17.8.0
.