https://github.com/vladimirakopyan/dockerdotnetdebug
Debuggable docker container for .Net Code, use with VS2017 or VSCode
https://github.com/vladimirakopyan/dockerdotnetdebug
docker docker-image dotnet-core ssh visual-studio visual-studio-2017 visual-studio-code vscode vsdbg
Last synced: 2 months ago
JSON representation
Debuggable docker container for .Net Code, use with VS2017 or VSCode
- Host: GitHub
- URL: https://github.com/vladimirakopyan/dockerdotnetdebug
- Owner: VladimirAkopyan
- License: mit
- Created: 2018-05-05T21:15:36.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-08T13:31:19.000Z (about 8 years ago)
- Last Synced: 2025-04-29T20:48:53.689Z (about 1 year ago)
- Topics: docker, docker-image, dotnet-core, ssh, visual-studio, visual-studio-2017, visual-studio-code, vscode, vsdbg
- Language: C#
- Homepage: https://blog.quickbird.uk/debug-netcore-containers-remotely-9a103060b2ff
- Size: 1.48 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DockerDotnetDebug
A remotely debuggable docker container, use it as your base runtime in desperate times, when you need to debug somehting remotely and you just can;t do all the tests locally.
# Quickstart
1. `docker run -d -p 2222:2222 -p 5000:5000 clumsypilot/dotnetdebug:asp-debug-sample`
2. Open `Localhost:5000` and verify thee website is running.
3. Clone the Repo and open project DotnetDebug in VS2017
4. Setup a remote connection over SSH
5. Set a breakpoint in `DebugSample/Pages/Index.cshtml.cs`
6. Start debugger and reload page!

Alternatively, debug this container while it's running on a kubernetes cluster using
```
kubectl port-forward 2222
```
For details, read my blogpost:
https://blog.quickbird.uk/debug-netcore-containers-remotely-9a103060b2ff
# Main Files
* **DebugSample** - a sample Asp.Net Core 2.0 applicaitonconfigured for debugging. It will serve a static page on `localhost:5000`
* **DebugASP.Dockerfile** - a dockerfile that builds a container with the asp applicaiton
* **Diagram.xml** - Draw.io diagram to illustrate how debugging .Net Core applications works
* **DotnetDebug.Dockerfile** - a dockerfile for buildings a debuggable base container for .Net Core applications. Used as base in **DebugASP.Dockerfile*
* **StartSSHAndApp.sh** - a script that starts two processes in **Docker**, the **OpenSSH** server and a **.Net Core** application
* **authorized_keys** - keys authorised for connection to the **OpenSSH** server, config file that must be copied to `root/.ssh/authorized_keys` into the container.
* **privateKey.openssh** and **privateKey.ppk** - OpenSSH Keys for **Putty**, corresponding to the **authorized_keys*
* **sshd_config** - a configuration file for OpenSSH server, that must be copied to `/etc/ssh/sshd_config`
* **DebugSample/MIEngineConfig/MIEngineAttach.json** - A configuration file for **MiEngine**, used in **Visual Studio 2017** to attach to a docker container for debugging.
* **DebugSample/.vscode/launch.json** - A configuration file for **Visual Studio Code** with an **Omnisharp Plugin** to attach to a remote docker container for debugging
* **DebugSample/Pages/Index.cshtml.cs** - set a breakpoint here on `public void OnGet()` and refresh the index page.