I have a Visual Studio solution with two projects. I would like to have the Dockerfile at the same level as my solution file (sln) instead of having it inside my API project (default behavior). I have tried several options, even adding to my API project:
<PropertyGroup>
<DockerfileContext>../Dockerfile</DockerfileContext>
</PropertyGroup>
However, Visual Studio is complaining "Error CTC1023 No Dockerfile could be found. Please make sure you have a Dockerfile called 'Dockerfile' adjacent to the project file"
Is it possible to have Docker integration with Visual Studio and place dockerfile at sln level?
Ok, I found the answer, will post it just in case someone face the same situation.
I added the following attribute in the API project csproj file:
<PropertyGroup>
<!--Other properties ... ->
<DockerfileFile>../Dockerfile</DockerfileFile>
</PropertyGroup>
Where ../Dockerfile is the relative path to the dockerfile from the main project. Now it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With