Container with sshd service
Add your pub key in authorized_keys file
cat ~/.ssh/id_ed25519 > authorized_keys
Build the image
docker build . --tag sshd
Launch the container in background
docker run -d -p 2222:22 --name sshd sshd
Connect in ssh to the container
ssh -i ~/.ssh/id_rsa guest@xxx.xxx.xxx.xxx -p 2222