HomeVideoHow to debug Docker containers! (Python + VSCode)

How to debug Docker containers! (Python + VSCode)

I recently encountered an issue where a python unit test was passing inside of a container, but failing locally.

In this video I show a few different tips/techniques for debugging code running within a docker container:

1) Modify the container entrypoint and exec into the container
2) Copy files to and from the container for inspection/comparison
3) Set up a remote debugger inside the container and attach to it from the host

I hope you find these helpful as you debug your own containerized applications.


Join the Community:
💬 Discord: https://discord.gg/3XzWctZ
💻 GitHub: https://github.com/sidpalas/devops-directive
🐥 Twitter: https://twitter.com/sidpalas
👨‍💼 LinkedIn: https://www.linkedin.com/in/sid-palas/
🌐 Website: https://devopsdirective.com

0:00 – Intro
0:57 – Sample test case overview
1:12 – Sample Dockerfile
2:28 – Tip #1 (modify entrypoint)
4:00 – Tip #2 (docker cp)
5:39 – Tip #3 (remote debugger)
7:16 – Configuring debugger in VSCode
8:54 – Closing thoughts

Community Size at Time of Posting:
– Subscribers: 225 🎉
– Channel Views: 3715

View it at Youtube

Most Popular