9

If I run

docker run -it ubuntu bash

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

Buvanesh Kumar
  • 467
  • 3
  • 5
  • 13
  • 5
    No, there is no SSH involved. Docker uses a technology called namespaces to provide the isolated workspace called the container. https://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
  • 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. – Michaël Le Barbier Aug 21 '17 at 15:38

1 Answers1

13

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

Gaius
  • 1,076
  • 9
  • 17