Skip to content

Instantly share code, notes, and snippets.

@xiaomi7732
Created May 19, 2023 04:58
Show Gist options
  • Save xiaomi7732/a0cb942121f1bef0d48219260e440f8b to your computer and use it in GitHub Desktop.
Save xiaomi7732/a0cb942121f1bef0d48219260e440f8b to your computer and use it in GitHub Desktop.
Bash into containers

Bash into containers

Docker container

docker exec -it <container name> /bin/bash

Kubernetes

kubectl exec --stdin --tty <pod name> -- /bin/bash

Opening a shell when a Pod has more than one container

kubectl exec -i -t <pod name> --container <container name> -- /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment