{"id":15009308,"url":"https://github.com/isaacbernat/docker-pudb","last_synced_at":"2025-08-16T01:16:25.102Z","repository":{"id":46638625,"uuid":"141415098","full_name":"isaacbernat/docker-pudb","owner":"isaacbernat","description":"Debug Python code within a Docker container remotely from your terminal using pudb","archived":false,"fork":false,"pushed_at":"2024-08-14T21:44:44.000Z","size":9,"stargazers_count":25,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T17:54:07.444Z","etag":null,"topics":["debug","debugger","debugging","debugging-tool","debugging-tools","docker","docker-compose","dockerfile","hacktoberfest","ipdb","pdb","pudb","python","python2","python27","python3","telnet"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isaacbernat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-18T09:48:24.000Z","updated_at":"2024-11-26T00:28:34.000Z","dependencies_parsed_at":"2025-04-09T17:49:57.815Z","dependency_job_id":null,"html_url":"https://github.com/isaacbernat/docker-pudb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/isaacbernat/docker-pudb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaacbernat%2Fdocker-pudb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaacbernat%2Fdocker-pudb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaacbernat%2Fdocker-pudb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaacbernat%2Fdocker-pudb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isaacbernat","download_url":"https://codeload.github.com/isaacbernat/docker-pudb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaacbernat%2Fdocker-pudb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270653594,"owners_count":24622793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debug","debugger","debugging","debugging-tool","debugging-tools","docker","docker-compose","dockerfile","hacktoberfest","ipdb","pdb","pudb","python","python2","python27","python3","telnet"],"created_at":"2024-09-24T19:24:22.841Z","updated_at":"2025-08-16T01:16:25.047Z","avatar_url":"https://github.com/isaacbernat.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-pudb\nDebug Python code within a Docker container remotely from your terminal using pudb.\n\n## Prerequisites:\n- [Python](https://docs.python.org/3/index.html) (versions 2.7 and 3.6+ supported)\n- [Docker](https://docs.docker.com/)\n- [pudb](https://documen.tician.de/pudb/)\n- [telnet client](https://en.wikipedia.org/wiki/Telnet)\n\n## How to do it?\n### Python\nJust add the following line wherever you want you entry point to be:\n```python\nfrom pudb.remote import set_trace; set_trace(term_size=(160, 40), host='0.0.0.0', port=6900)\n```\nIf you wanted to debug using `pudb` locally you'd write instead:\n```python\nimport pudb; pu.db\n```\nWhich is similar to how one would do it for the built-in pdb:\n```python\nimport pdb; pdb.set_trace()\n```\n\n### Docker\n#### Dockerfile\n- `pudb` needs to be installed on the Docker image. One way to do it is adding this line to the Dockerfile:\n```\nRUN pip install pudb\n```\n- 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:\n```\nEXPOSE 6900\n```\n\n#### docker-compose\nIf you use docker-compose yml files the syntax is different. You should add:\n```\nports:\n    - \"6900:6900\"\n```\n\n### Telnet\n**Mac users:** If you don't have any `telnet` client, you can install one via [Homebrew](https://brew.sh/). Type `brew install telnet` on your terminal.\n\nWhen 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\n\n## Try it out!\nClone this repository and from its root folder run:\n```sh\n# Optional: try it on Python 2.7 instead of 3.6+\ncd python2\n\n# Build the Docker image\ndocker build -t pudb-example .\n\n# Run the container (in the background) exposing port 6900\ndocker run -p 6900:6900  --detach pudb-example\n\n# Connect to pudb via telnet\ntelnet 127.0.0.1 6900\n\n# Enjoy debugging and star the repo if you liked it!\n```\n\n## Acknowledgements\n- Inspiration came from [this blog post](http://kartowicz.com/dryobates/2016-09/debugging_gunicorn_on_docker_with_pudb/). There was no code readily available to try it out, so I created this repository.\n- This repository is used as a reference for this related [Stack Overflow entry](https://stackoverflow.com/questions/36885957/running-pudb-inside-docker-container/51404762#51404762)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaacbernat%2Fdocker-pudb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisaacbernat%2Fdocker-pudb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaacbernat%2Fdocker-pudb/lists"}