All Projects → isaacbernat → docker-pudb

isaacbernat / docker-pudb

Licence: MIT license
Debug Python code within a Docker container remotely from your terminal using pudb

Programming Languages

python
139335 projects - #7 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to docker-pudb

Gdb Frontend
☕ GDBFrontend is an easy, flexible and extensionable gui debugger.
Stars: ✭ 2,104 (+11588.89%)
Mutual labels:  debugger, debugging, debug, debugging-tools, debugging-tool
Wasmite
Now WebAssembly has proper testing, unit-testing and debugging 🤗
Stars: ✭ 20 (+11.11%)
Mutual labels:  debugger, debug, debugging-tools, debugging-tool
Cocoadebug
iOS Debugging Tool 🚀
Stars: ✭ 3,769 (+20838.89%)
Mutual labels:  debugger, debugging, debug, debugging-tool
nopdb
NoPdb: Non-interactive Python Debugger
Stars: ✭ 67 (+272.22%)
Mutual labels:  debugger, pdb, debugging-tools, debugging-tool
dwarf import
This loads DWARF info from an open binary and propagates function names, arguments, and type info
Stars: ✭ 18 (+0%)
Mutual labels:  debugging, debug, debugging-tools, debugging-tool
bugsnag-vue
[DEPRECATED] This package now lives within the monorepo for our Universal JS notifier "@bugsnag/js" • https://github.com/bugsnag/bugsnag-js
Stars: ✭ 26 (+44.44%)
Mutual labels:  debugging, debug, debugging-tools, debugging-tool
SmartDump
SmartDump - an exception and memory dump capture utility
Stars: ✭ 17 (-5.56%)
Mutual labels:  debugger, debugging, debug
Frodo2
Android Library for Logging RxJava2 Components
Stars: ✭ 142 (+688.89%)
Mutual labels:  debugger, debugging, debugging-tool
TrackJS-Node
TrackJS Error Monitoring agent for NodeJS
Stars: ✭ 26 (+44.44%)
Mutual labels:  debugger, debugging, debugging-tool
gdbundle
Minimalist plugin manager for GDB and LLDB
Stars: ✭ 72 (+300%)
Mutual labels:  debugger, debugging, debug
Remotedebug
Library for Arduino to debug projects over WiFi, with web app or telnet, with print commands like Serial Monitor
Stars: ✭ 467 (+2494.44%)
Mutual labels:  debugger, telnet, debug
Scyllahide
Advanced usermode anti-anti-debugger. Forked from https://bitbucket.org/NtQuery/scyllahide
Stars: ✭ 2,211 (+12183.33%)
Mutual labels:  debugger, debugging, debug
bugsnag-java
Bugsnag error reporting for Java.
Stars: ✭ 51 (+183.33%)
Mutual labels:  debugging, debug, debugging-tool
Frodo
Android Library for Logging RxJava Observables and Subscribers.
Stars: ✭ 1,496 (+8211.11%)
Mutual labels:  debugger, debugging, debugging-tool
Strongod
StrongOD(anti anti-debug plugin) driver source code.
Stars: ✭ 76 (+322.22%)
Mutual labels:  debugger, debug, debugging-tool
Ios Sdk
AppSpector is a debugging service for mobile apps
Stars: ✭ 56 (+211.11%)
Mutual labels:  debugger, debug, debugging-tool
Pudb
Full-screen console debugger for Python
Stars: ✭ 2,267 (+12494.44%)
Mutual labels:  debugger, pdb, debug
madbomber
Backtrace-on-throw C++ exception logger
Stars: ✭ 17 (-5.56%)
Mutual labels:  debugger, debugging, debugging-tool
ducky
Chrome extension to overlay a (super adorable) rubber duck, as a virtual companion during rubber duck debugging.
Stars: ✭ 80 (+344.44%)
Mutual labels:  debugging, debug, debugging-tool
ircpdb
Remotely and collaboratively debug your Python application via an IRC channel.
Stars: ✭ 59 (+227.78%)
Mutual labels:  debugger, debugging, pdb

docker-pudb

Debug Python code within a Docker container remotely from your terminal using pudb.

Prerequisites:

How to do it?

Python

Just add the following line wherever you want you entry point to be:

from pudb.remote import set_trace; set_trace(term_size=(160, 40), host='0.0.0.0', port=6900)

If you wanted to debug using pudb locally you'd write instead:

import pudb; pu.db

Which is similar to how one would do it for the built-in pdb:

import pdb; pdb.set_trace()

Docker

Dockerfile

  • pudb needs to be installed on the Docker image. One way to do it is adding this line to the Dockerfile:
RUN pip install pudb
  • The port pudb is listening to must be open. In our example it is 6900. One way to do it is adding to your Dockerfile:
EXPOSE 6900

docker-compose

If you use docker-compose yml files the syntax is different. You should add:

ports:
    - "6900:6900"

Telnet

Mac users: If you don't have any telnet client, you can install one via Homebrew. Type brew install telnet on your terminal.

When all above is done, run the container. When the entrypoint is reached, the code execution will stop. Then you need to connect to it via a telnet client, e.g. telnet 127.0.0.1 6900. Now you will see the pudb screen and debugging can start :D

Try it out!

Clone this repository and from its root folder run:

# Build the image
docker build -t pudb-example .
# Run the container (in the background) with port 6900 open
docker run -p 6900:6900  --detach pudb-example
# Connect to pudb via telnet
telnet 127.0.0.1 6900
# Enjoy debugging and star the repo if you liked it!

Acknowledgements

  • Inspiration came from this blog post. There was no code readily available to try it out, so I created this repository.
  • This repository is used as a reference for this related Stack Overflow entry
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].