A Docker debugging CLI tool
Project description
🐳 Docker Lens
Docker Lens is a lightweight, developer-friendly CLI tool for debugging running Docker containers.
It lets you instantly attach a fully-featured debug container to any running container — sharing network, PID, and filesystem namespaces — similar to docker debug, but open-source and pip-installable.
Think of it as:
kubectl debugfor Docker containers 🔍
{ width=400px }
✨ Features
- 🔗 Attach a debug container to any running container
- 🧠 Shares network, PID, and volumes
- 🖥️ Fully interactive TTY
- 🧹 Debug container is removed automatically on exit
- 📦 Auto-pull debug images if missing
- ⚙️ Configurable default debug image (profiles or custom)
- 🐍 Written in Python, installable via
pip
📦 Installation
python3 -m venv venv
source venv/bin/activate
pip install docker-lens
Requirements
- Python 3.10+
- Docker installed and running
- Access to Docker socket (
/var/run/docker.sock)
🚀 Usage
List containers
docker-lens
Equivalent to:
docker ps
Debug a running container
docker-lens debug <container_id_or_name>
Example:
docker-lens debug web-api
Specify debug image or shell
docker-lens debug web-api --image ubuntu:latest --shell /bin/bash
Change the default debug image
Use any custom image:
docker-lens set image jonlabelle/network-tools
Or use one of the pre-defined debug image profiles:
docker-lens set image network
🧰 Debug Image Profiles
| Profile | Usage | Image |
|---|---|---|
| minimal | common system and networking essentials. | kavehmoradian/docker-lens:minimal |
| network | Focused on network debugging and analysis. | kavehmoradian/docker-lens:network |
| process | Focused on process, system, and application debugging. | kavehmoradian/docker-lens:process |
| full | Includes everything from both network and process. | kavehmoradian/docker-lens:full |
⚙️ Configuration
Config file location:
~/.config/docker-lens/config.yaml
Example:
default_image: kavehmoradian/docker-lens:minimal
🔐 Permissions
If you see:
Permission denied while connecting to Docker socket.
Fix it:
sudo usermod -aG docker $USER
newgrp docker
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file docker_lens-0.1.1.tar.gz.
File metadata
- Download URL: docker_lens-0.1.1.tar.gz
- Upload date:
- Size: 19.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f108674fa6a8645cefbeb3f606853fe86b4ee07492ee506109eddd1018221374
|
|
| MD5 |
c46adfc4b570692f8ee08dde5904c08e
|
|
| BLAKE2b-256 |
82d6e68c54dd17fd37017486a24f5fabacf37297cca9b47fdb72a9f86032c7fe
|
File details
Details for the file docker_lens-0.1.1-py3-none-any.whl.
File metadata
- Download URL: docker_lens-0.1.1-py3-none-any.whl
- Upload date:
- Size: 20.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f15f0ae76697f11200acd0e13f311da45fd58afb3adb9424db4740e7c69de375
|
|
| MD5 |
fd8e1a6295437bc40ad363edbee7ed1e
|
|
| BLAKE2b-256 |
c5c425bbbcc1f4e4fe5283967d9d39db23d1c6b77ab118160f8ac5bf88c972b1
|