Git Product home page Git Product logo

docker.dotnet.debug's People

Contributors

sleemer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker.dotnet.debug's Issues

Consider using volumes

Hi,
An option for allowing debugging without needing to recreate the container everytime is to use a volume to share vsdbg and the source code with the container.

Given a multistage Dockerfile, that builds your netcore image and a valid compose file that allows you to start it, you can write another compose file to debug your container:

version: '3.4'

services:
  api:
    image: myapi:dev
    build:
      target: base
    labels:
      - "com.microsoft.visualstudio.targetoperatingsystem=linux"
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
      - DOTNET_USE_POLLING_FILE_WATCHER=1
    volumes:
      - .:/app
      - ~/.nuget/packages:/root/.nuget/packages:ro
      - ~/vsdbg-core:/vsdbg:ro
    entrypoint: tail -f /dev/null

Key points:

  • Using a bind mount to share the source code with container
  • Using a bind mount to share nuget cache
  • Using a bind mount to share vsdbg with the container (for this to work you need to download vsdbg on your host of course)
  • Stay on "base" stage
  • Redefining entrypoint to "do nothing"

Basically this compose makes my container to be "like the basic image" (base stage), and do nothing. Source code and vsdbg is provided through bind mounts. You can start the container once and "forget about it". Then just need a "docker exec" to run vsdbg on it.

Base stage is the typical initial stage in the Dockerfile:

FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
EXPOSE 80
# end of this stage

No such container error

Hi, thanks for sharing your config, but unfortunately it isn't working properly with the latest version of VSCode.

I tried to apply to my project and it didn't work, and then I decided to use your git sample but I still getting the same error:

Starting: "docker" exec -i docker.dotnet.debug_1 /vsdbg/vsdbg --interpreter=vscode Error from pipe program 'docker': Error: No such container: docker.dotnet.debug_1

Could you highlight how can I solve this issue? have you tested with the latest version of VSCode?

Best regards,
M

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.