Run the container :
$ docker run -d -P -e SSH_KEY='YOUR PUB KEY' ayoubensalem/ayman
Get the container ip :
$ docker inspect CONTIAINER_ID | jq -r ".[0].NetworkSettings.Networks.bridge.IPAddress"
Try to ssh into it :
$ ssh ayman@CONTAINER_IP
RUN THIS COMMAND :
$ ssh-keygen
When done, copy the PUB KEY generated and in the host type this command:
$ echo "PUB_KEY" >> authorized_keys
Make sur that the authorized_keys has 644.
And now, you could be able to ssh from the container to the host.