https://github.com/hmarr/debug-tools
🔧 Docker image with useful debugging tools
https://github.com/hmarr/debug-tools
Last synced: about 1 year ago
JSON representation
🔧 Docker image with useful debugging tools
- Host: GitHub
- URL: https://github.com/hmarr/debug-tools
- Owner: hmarr
- License: mit
- Created: 2019-05-03T13:15:44.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2021-03-26T03:45:28.000Z (about 5 years ago)
- Last Synced: 2025-03-31T08:16:41.974Z (about 1 year ago)
- Language: Dockerfile
- Homepage:
- Size: 6.84 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# debug-tools
A Docker image with several useful debugging tools. Check the Dockerfile to see
which packages are installed.
## Usage
Published to [Docker Hub](https://hub.docker.com/r/hmarr/debug-tools) as
`hmarr/debug-tools`.
The following shell function runs this image in the same pid and network
namespaces as another container (specified as the first argument). It also has
the permissions required to run strace.
```bash
docker-debug() {
if [ -z "$1" ]; then
echo "usage: docker-debug CONTAINER-ID"
return 1
fi
echo "Starting debug sidecar for container $1"
[ ! -d "/tmp/debug-$1" ] && mkdir "/tmp/debug-$1"
echo "Mounting /scratch to /tmp/debug-$1"
docker run --rm -ti \
--name="debug-${1:0:6}" \
--workdir="/scratch" \
--volume="/tmp/debug-$1:/scratch" \
--pid="container:$1" \
--network="container:$1" \
--cap-add sys_admin \
--cap-add sys_ptrace \
hmarr/debug-tools
}
```