How to SSH into Docker?
问题 I'd like to create the following infrastructure flow: How can that be achieved using Docker? 回答1: Firstly you need to install a SSH server in the images you wish to ssh-into. You can use a base image for all your container with the ssh server installed. Then you only have to run each container mapping the ssh port (default 22) to one to the host's ports (Remote Server in your image), using -p <hostPort>:<containerPort> . i.e: docker run -p 52022:22 container1 docker run -p 53022:22 container2