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
– oryadesAug 21 '17 at 11:24
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 BarbierAug 21 '17 at 15:38
docker run -it --rm ubuntu su -rather than running bash. Runningsu -simulates a full login and as a result, initialises some environment variables such asTERM. – Michaël Le Barbier Aug 21 '17 at 15:38