Skip to content

🔧 Docker image with useful debugging tools

License

Notifications You must be signed in to change notification settings

hmarr/debug-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

debug-tools

A Docker image with several useful debugging tools. Check the Dockerfile to see which packages are installed.

Usage

Published to Docker Hub 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.

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
}

About

🔧 Docker image with useful debugging tools

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published