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.
Cheers!
---
Join the Community:
💬 Discord: / discord
💻 GitHub: github.com/sidpalas/devops-di...
🐥 Twitter: / sidpalas
👨💼 LinkedIn: / sid-palas
🌐 Website: devopsdirective.com
---
Timestamps:
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
28 май 2024