How to SSH into Docker containers using the docker run command and a Dockerfile.
Clone the Dockerfile and run the docker build command
sudo docker build -t name_on_the_image .
Run docker run to create and run the container from the image telling Docker to run the image in the background (-d)
docker run -d --name name_on_container -p 22:22 name_on_the_image
sudo docker port test_sshd_container
Try ssh into your container by using your ip-adress on your computer, example ssh 192.168.100.1:22.
Windows-users