0
votes

Hi I came from PHP world and want to play around with Dotnet Core.

I have working application inside a docker. To build and run the app I've prepared some Run configuration using JetBrains Rider which runs my docker-compose file.

version: '3'

services:
  dotnet:
    build:
      context: ./
      dockerfile: Docker/Dockerfile
    ports:
      - "8080:80"
      - "10777:22"
    volumes:
      - ./:/app
    command: dotnet run -c Debug
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
    container_name: myapp_dotnet

Now I would like to debug the application but so far didn't find any way to do it.

What I found until now is:

I have found an issue on JetBrains tracker: https://youtrack.jetbrains.com/issue/RIDER-742 which is about adding debugger support for Docker. But maybe someone have some workaround to deal with it?

PS. Is it a good/common practice in Dotnet Core world to develop an application inside a docker or it is senseless?

1
Visual Studio has support for remote debugging, including in docker containers. But this is an advanced feature and I have not seen it implemented anywhere else, so if Rider or other project does not support it at all I would not be surprised. Instead you should debug your application outside of your container using features that your IDE provides. When you are happy with it package it into a docker image and deploy the image to your docker (cluster) as a container.Andrew Savinykh
Thank you for your response, that's probably what I am going to do. Unluckily the new release of Rider (which according to Riders's YouTrack should have the feature) doesn't include debugging in the container.czeski

1 Answers

2
votes

JetBrains added initial docker debugging support in latest EAP version. You can't debug docker-compose projects yet, but you already can debug standard docker containers.