How to debug Docker containers! (Python + VSCode)

  Рет қаралды 51,216

DevOps Directive

DevOps Directive

Күн бұрын

Пікірлер
@datamike7457
@datamike7457 4 жыл бұрын
Nice video. I've been exploring docker containers and the extra abstraction makes debugging more awkward. This was super helpful!
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Thanks Mike! Relevant to your area of expertise, containers can be a game-changer for eliminating dependency issues for data science work: - Have a legacy model that is still living in the past and requires Python 2.7? No problem! - Need different versions of TensorFlow various applications you are developing? Sure! - Calling out to some 3rd party tool that only runs in Linux? Great!
@meigu01
@meigu01 4 жыл бұрын
@@DevOpsDirective Hi i got Error: -m: missing , is this correct? ENTRYPOINT ["python","-m","debugpy", "listen", "0.0.0.:5678", "--wait-for-client","-m"]
@TuomoKankaanpaa
@TuomoKankaanpaa 4 жыл бұрын
Wow the remote debugger and attaching it to vs code will really come in handy! And congrats on the 200 subs 🙌🎉
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Thanks! -- Yes, it takes a bit of work to have the separate Dockerfile stage, but for debugging complex issues it is really the way to go!
@akozy
@akozy 3 жыл бұрын
This is what I was looking for!!! It seemed so hard to find for some reason. Can't wait to see your channel grow. Keep it up!
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Well, I'm glad you found your way to my little corner of KZbin! 😁 Welcome to the team! 👋
@thebluechimera
@thebluechimera 4 жыл бұрын
Great video! I've always found Docker quite intimidating, this was good to watch
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Thanks @Maria! It is a bit of a steep learning curve, but once you get used to it, the added confidence that something in production will behave the same way as on your laptop is amazing!
@thebluechimera
@thebluechimera 4 жыл бұрын
@@DevOpsDirective I know right! Quite an awesome feeling
@AZIARGROUS
@AZIARGROUS 3 жыл бұрын
Thank you man! This is exactly the kind of concept I was playing with these days. Thank you for explaining how to expose that port from docker to local host.
@DevOpsDirective
@DevOpsDirective 2 жыл бұрын
You are welcome, Paolo!
@kab9996
@kab9996 3 жыл бұрын
Thanks for the best and the clearest tutorial on how to debug python into Docker with VSC !
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Woot! Thanks @Ka -- your comment makes me smile :)
@timaudsley6080
@timaudsley6080 4 ай бұрын
Thanks, this is exactly what I required!
@machinelearningid3931
@machinelearningid3931 4 жыл бұрын
From traversy, thanks, your devops video are awesome.
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Welcome aboard @Machine Learning ID! 👋👋👋 Happy to have you here!
@ערןאוצפ
@ערןאוצפ 2 жыл бұрын
Great video, thanks !
@DevOpsDirective
@DevOpsDirective 2 жыл бұрын
You're welcome! 🎉
@SgtMajorJay
@SgtMajorJay 4 жыл бұрын
Your videos are fire
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Thanks @SomeDude! 🔥🔥🔥
@Buckheadmaniac
@Buckheadmaniac Ай бұрын
which directory of the github repo should I look for this video?
@abrahammathewos9917
@abrahammathewos9917 3 жыл бұрын
Thank you! you are the best.
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Thank you @Abraham! Comments like this make me want to keep putting out even better videos!
@plashless3406
@plashless3406 3 жыл бұрын
This is really amazing. I'm having a use case would really appreciate for helping me out. :) I'm running services in Docker Containers i-e web, db, worker(celery). Is there any way so that I can add a breakpoint in the Pycharm(code) and it will start the debugger in the containers(specifically celery worker)?
@ShikhaSingh04
@ShikhaSingh04 10 ай бұрын
Can you suggest any other dependency for debugging else than debugpy?
@SaifPasha-s7t
@SaifPasha-s7t 10 ай бұрын
I have my dockerfile made and Im using fastapi python but when I run my application via that play button of VSCODE I run into a error called PYTHON PATH IN YOUR DEBUG CONFIGURATION IS INVALID. please help me with that ..
@danh_phuong9297
@danh_phuong9297 3 жыл бұрын
That's great. I'm looking for debugging C in docker with VSCode. Please suggest any solution !!!
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
One options would be to have a multi-stage image with an extra Debugger stage in which you install any of your favorite debugging tools. This way you can keep your production image small but have an image to recreate any bugs in that has the necessary tools for debugging
@edustreamimg
@edustreamimg 4 жыл бұрын
good job buddy!
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Thanks @Eduardo!
@edustreamimg
@edustreamimg 4 жыл бұрын
@@DevOpsDirective In 6:35 you are creating 3 images?
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
@@edustreamimg Yeah, here is more info on multi-stage builds docs.docker.com/develop/develop-images/multistage-build/ By using the --target option when building the Dockerfile I can tell Docker which of the stages I want it to build (docs.docker.com/develop/develop-images/multistage-build/#stop-at-a-specific-build-stage)
@edustreamimg
@edustreamimg 4 жыл бұрын
@@DevOpsDirective Is a good practice not to run debugger in same container? why?
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
@@edustreamimg There are a number of reasons you wouldn't want to have a debugger running inside your production container. The three that come to mind are: 1) Simplicity -- Each container should have a singular focus. By adding a debugger, you lose that. 2) Security -- It's best not to have additional surface area for potential attackers to try and exploit (you would need to open an additional port to access, etc...) 3) Performance -- having the debugger running is one more thing to take compute cycles away from your application KZbin comments are a bit clunky for technical discussions. I have a discord server if you want to continue the discussion with lots of other smart folks! discord.gg/CQYSqKvqqa
@kid_kulafu_1727
@kid_kulafu_1727 4 жыл бұрын
Who’s here because you saw this dude on brads channel? Thank you for this sir.
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Hi @aRtoo _ -- Welcome! 😄
@mariacristinaarezzi
@mariacristinaarezzi Жыл бұрын
I'm happy to meet you
@uncoding_with_raj
@uncoding_with_raj Жыл бұрын
Can we connect VSCODE debugger AUTOMATICALLY to docker container without hitting the play button in VSCODE ?
@yuriwolf6234
@yuriwolf6234 11 ай бұрын
Dear Sid, do I have to rebuild the docker image every time I modify something in my .py file? thanks regards
@yuriwolf6234
@yuriwolf6234 11 ай бұрын
just answering myself: I got to mount the :/app directory on the container to a path on my local machine where i copy my files docker run -v /path/on/local/machine :/app -p 5678:5678 image_id main_python_file
@acavaelnick
@acavaelnick 3 жыл бұрын
Great, thanks
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
You are welcome, @Joaquin!
@nareshmp1
@nareshmp1 2 жыл бұрын
Nice video. Is it possible to debug the code step by step? Especially when its web2py app?
@DevOpsDirective
@DevOpsDirective 2 жыл бұрын
Once you have attached the debugging session as shown in the video you should be able to step through to any breakpoints you set!
@jansoriano7451
@jansoriano7451 4 жыл бұрын
Hi Sid, I've seen your video tutorial on Brads channel. I'm currently a shopify dev, and I want to become a devops engineer. I am hoping to get tips from you or your channel. Thanks!
@DevOpsDirective
@DevOpsDirective 4 жыл бұрын
Hi @Jan - Happy to have you here! Welcome to the team! 👋👋👋
@jansoriano7451
@jansoriano7451 4 жыл бұрын
@@DevOpsDirective Thanks Sid!
@jarorkwong8042
@jarorkwong8042 3 жыл бұрын
Volumn up
@DevOpsDirective
@DevOpsDirective 3 жыл бұрын
Thanks, this was before I had figured out the whole audio recording/editing thing... 😅 Hopefully my newer videos have better, more consistent audio!
Docker VSCode Python Tutorial // Run your App in a Container
19:13
Christian Lempa
Рет қаралды 101 М.
How To Use Docker To Make Local Development A Breeze
21:53
ArjanCodes
Рет қаралды 332 М.
24 Часа в БОУЛИНГЕ !
27:03
A4
Рет қаралды 7 МЛН
Andro, ELMAN, TONI, MONA - Зари (Official Music Video)
2:50
RAAVA MUSIC
Рет қаралды 2 МЛН
IAM Custom Roles | Lab Solution #arcade2025
3:47
Learn with me
Рет қаралды 1
18 Weird and Wonderful ways I use Docker
26:18
NetworkChuck
Рет қаралды 490 М.
If you're not developing with this, you're wasting your time
14:30
Articulated Robotics
Рет қаралды 317 М.
Using docker in unusual ways
12:58
Dreams of Code
Рет қаралды 469 М.
Video #4: Debugging Python with VS Code
35:25
Matt Spataro
Рет қаралды 14 М.
Debugging a Dockerized Django app with VSCode
23:22
London App Developer
Рет қаралды 36 М.
Debugging Python in Docker using VSCode
11:15
That DevOps Guy
Рет қаралды 39 М.
100+ Docker Concepts you Need to Know
8:28
Fireship
Рет қаралды 1,1 МЛН
Why Does Kubernetes Exist?
7:04
DevOps Directive
Рет қаралды 13 М.
24 Часа в БОУЛИНГЕ !
27:03
A4
Рет қаралды 7 МЛН