Sign inSign up

hmarr/debug-tools

By hmarr

Updated over 5 years ago

Docker image with useful debugging tools

Image
0

1.7K

hmarr/debug-tools repository overview

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
}

Tag summary

Content type

Image

Digest

Size

90.5 MB

Last updated

over 5 years ago

docker pull hmarr/debug-tools