Open eiximenis opened 6 years ago
Hi @eiximenis, thanks for sharing your solution. It's looks great, but the only problem that I can see is that you force everyone having nuget packages and vsdbg at the same path as you have. But that's not always possible. My original approach doesn't make any assumptions about your fs structure.
Hi! ;-)
About nuget packages, what is shared with container is the "nuget package cache folder" which is located in ~/.nuget (%USERPROFILE%\.nuget in win) in almost all nuget installations.
About vsdbg, you're true: need to download and store somewhere in your disk. Location is up to you, just update compose file to reflect your location. I. e. if you are in Windows and have VS installed with Docker Tools you already should have vsdbg in ~/vsdbg/vs2017u5 folder
Thanks!!
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:
Key points:
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: