Not generating docker-compose configuration override for debug purposes

Reproduction: create new .NET Web API project, add default Dockerfile, add docker-compose.yml with simple service and build entry pointing and Dockerfile and solution context. Add docker-compose configuration pointing at created docker-compose.yml file. Start debugging with this configuration.

What happens: debugger is not attached. app runs without generating rider's docker-compose file with things needed for debugging. It started happenning after updating rider from 2023.1.4 to 2023.2. Before it worked without problems.

What should happen: rider's docker compose is generated and app starts in container under docker-compose and debugger is attached.

0
3 comments

Okay, for everyone interested there is very easy workaround to above problem - use visual studio and option of adding orchestrator docker-compose support to project - it generates separate project and after that it can be used in rider and debugger attaches correctly and rider generated required docker-compose file automatically.

0

Okay i found the reason: when specyfing path to dockerfile in docker-compose.yml, the path cannot start with slash.

WRONG:

services:
testcomposeapp.api:
image: testcomposeapp
build:
context: .
dockerfile: /TestComposeApp/Dockerfile

GOOD:

services:
testcomposeapp.api:
image: testcomposeapp
build:
context: .
dockerfile: TestComposeApp/Dockerfile

After removing this "/" and restarting IDE it worked perfectly. It can also be reproduced easily just by adding this slash in path to dockerfile i docker-compose file.

0

Hi Adam!

I've happy to hear that solution was found. However, please tell me how you got this docker-compose file. Was it generated by any IDE or written manually? 

The docker documentation indicates that a relative path must be resolved from the build context. So we want to be sure there is no scenario when Rider generates this path in the wrong way. 

Thank you in advance! 

0

Please sign in to leave a comment.