If I run

docker run -it ubuntu bash

Does it actually SSH into the container, or does it use another protocol?

  • 5
    No, there is no SSH involved. Docker uses a technology called namespaces to provide the isolated workspace called the container. docs.docker.com/engine/docker-overview/#namespaces
    – oryades
    Aug 21, 2017 at 11:24
  • 2
    @oryades you should think about turning this comment in an answer IMHO.
    – Tensibai
    Aug 21, 2017 at 13:45
  • 2
    As a side note in most cases you want to docker run -it --rm ubuntu su - rather than running bash. Running su - simulates a full login and as a result, initialises some environment variables such as TERM. Aug 21, 2017 at 15:38

1 Answer 1


No, it uses an internal "attach protocol" via the Docker daemon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.