Skip to content

🔧 A handy Docker image to troubleshoot from a Docker container.

License

Notifications You must be signed in to change notification settings

voroninman/docker-debug-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Docker debug image

🔧 A handy Docker image to troubleshoot from a Docker container.

Usage

Locally:

docker run -ti --rm voroninman/debug bash

On Kubernetes:

kubectl run debug-shell --rm -it --image voroninman/debug -- /bin/bash

Advanced usage

Locally:

Get access to the host filesystem and network.

docker run -ti --rm --net host -v /:/host voroninman/debug bash

Get access to a container network and PIDs.

docker run -ti --rm \
	--pid container:$CONTAINER_ID \
	--net container:$CONTAINER_ID \
	--cap-add NET_RAW \
	--cap-add NET_ADMIN \
	--cap-add SYS_PTRACE \
	voroninman/debug bash

On Kubernetes:

If the EphemeralContainers feature is enabled, spawn a shell in the sidecar debugging container with the pod's network and PIDs.

kubectl debug $POD_NAME -ti \
	--image=voroninman/debug \
	--share-processes \
	-- bash

If the EphemeralContainers feature is disabled, run a copy of the pod first and then spawn a shell in the sidecar debugging container with the copied pod's network and PIDs.

kubectl debug $POD_NAME -ti \
	--image=voroninman/debug \
	--share-processes \
	--copy-to=$POD_NAME-debug \
	-- bash

# Cleanup when you're done
kubectl delete pod $POD_NAME-debug

About

🔧 A handy Docker image to troubleshoot from a Docker container.

Topics

Resources

License

Stars

Watchers

Forks