Sign inSign up

voroninman/debug

By voroninman

•Updated over 3 years ago

šŸ”§ A handy Docker image to troubleshoot from a Docker container.

Image
0

1.0K

voroninman/debug repository overview

https://github.com/voroninman/docker-debug-image⁠

⁠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

Tag summary

Content type

Image

Digest

sha256:06d93d32a…

Size

272.1 MB

Last updated

over 3 years ago

docker pull voroninman/debug