Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Real-World Docker Images für .NET

Real-World Docker Images für .NET

Docker Images erlauben die standardisierte Verteilung und den homogenen Betrieb von Anwendungen, unabhängig der gewählten Technologie oder Programmiersprache. Jedoch gilt es einiges beim Erstellen von Docker Images zu beachten.

In diesem Webinar zeigt Cloud-Native-Enthusiast und Docker Captain Thorsten Hans, wie Docker Images für reale .NET-Projekte aussehen sollten, um unterschiedliche Aspekte wie effizientes Debugging und die Inner-Loop Performance zu adressieren. Darüber hinaus werden Sie lernen, wie Sie potenzielle Stolpersteine und Schwächen der “Standard”-.NET-Dockerfiles von Microsoft ausmerzen.

Thorsten Hans

October 20, 2022
Tweet

More Decks by Thorsten Hans

Other Decks in Technology

Transcript

  1. What we will cover today • Introduction • Production grade

    Docker images for .NET Apps • Remote debugging .NET Apps in Docker containers • Inner-Loop Performance for .NET Apps with Docker • Conclusion Talking Points
  2. Why are we talking about that • Different requirements must

    be addressed when building Docker images • Robust and secure for production usage • Troubleshooting and debugging should be easy • Fast feedback is required for inner-loop experience • Sometimes you may want to address all of those requirements using a single Dockerfile Introduction
  3. What we will cover today • Introduction • Production grade

    Docker images for .NET Apps • Remote debugging .NET Apps in Docker containers • Inner-Loop Performance for .NET Apps with Docker • Conclusion Talking Points P R
  4. - We’ll start from the default Dockerfile generated by VS

    Code - We’ll optimize overall image build-time by - Removing unnecessary stages - Streamline build and publish for .NET - Address common pitfalls for running real-world workloads in containers Production grade Docker images for .NET Apps
  5. What we will cover today • Introduction • Production grade

    Docker images for .NET Apps • Remote debugging .NET Apps in Docker containers • Inner-Loop Performance for .NET Apps with Docker • Conclusion Talking Points
  6. - VS Remote Debugger is not installed by default -

    Remote debugger could be - baked into the Docker Image - Installed on demand using docker exec (VSCode does that too, but it’s terrible slow) - Consider strict tagging policies when baking remote debugger into your images to differenciate between debug- and non-debug images Remote debugging .NET Apps in Docker containers
  7. What we will cover today • Introduction • Production grade

    Docker images for .NET Apps • Remote debugging .NET Apps in Docker containers • Inner-Loop Performance for .NET Apps with Docker • Conclusion Talking Points E
  8. - As developers, we want fast feedback to improve our

    overall productivity - Hot-Reload is provided by dotnet watch - Rude edits will result in the app process being restarted - Set DOTNET_WATCH_RESTART_ON_RUDE_EDIT=true to force restart also when rude edits happen Inner-Loop Performance for .NET Apps with Docker
  9. What we will cover today • Introduction • Production grade

    Docker images for .NET Apps • Remote debugging .NET Apps in Docker containers • Inner-Loop Performance for .NET Apps with Docker • Conclusion Talking Points
  10. What we’ve covered • You’ve seen how to • optimize

    “OOB-Dockerfiles” for .NET Apps • add VS Remote Debugger to Docker images for .NET • optimze your inner-loop performance when building .NET Apps Conclusion
  11. What we’ve covered • Identify and address different requirements as

    early as possible • Optimize your Docker images to stay productive in the inner-loop • Lint your Docker images to meet containerization best practices (e.G. dockle) • Harden your Docker images and check for vulnerabilities (docker scan) Conclusion