In case you are running a docket and minikube or some other kubernetes, here are ways to ssh to a container:
- To ssh to a pod (use -c container-name in case pod have multiple containers)
kubectl exec –stdin –tty pod-name — /bin/bash
orkubectl exec -it pod-name -- /bin/bash
- ssh to minikube container using minikube
minikube ssh - ssh to minikube container using docker
docker exec -it minikube /bin/bash