This article introduces how to SSH into Ubuntu in Docker.
I just wrote an article about this recently, but it didn’t work with 18.04, so I looked into it. It seems there’s an image available, and using this is faster.
docker run -d -P --name ubuntu18.04_sshd -v /media/ownCloud/pg/docker/mnt/:/docker rastasheep/ubuntu-sshd:18.04
docker port ubuntu18.04_sshd 22 # e.g. 0.0.0.0:49154
ssh root@localhost -p <PORTNUM> # password is `root`