9

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 '17 at 11:24
  • 2
    @oryades you should think about turning this comment in an answer IMHO. – Tensibai Aug 21 '17 at 13:45
  • 1
    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. – Michael Le Barbier Grünewald Aug 21 '17 at 15:38
12

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, privacy policy and cookie policy

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