Adam Johnston

Exec-ing into a container

I often find a need to exec into a running Docker container and it’s pretty straight forward to do:

docker exec -it [container-name] /bin/sh

This is similar if you need to exec into a running Kubernetes pod:

kubectl exec -it [pod-name] /bin/sh

Finding a pod is as simple as doing:

kubectl get pods | grep [pod-name]