The original docker-ssh-exec (https://github.com/mdsol/docker-ssh-exec) has 2 issues:
1) It expects an env variable DOCKER-SSH-KEY to contain the key. Hyphens, unfortunately, are not allowed in most shells.
2) SSH keys contain newlines.
For the life of me I haven't managed to pass an SSH key, with its newline characters through the DOCKER-SSH-KEY variable.
How to use:
You'll need to pass your SSH key as one line, all newlines converted to \n, as an environment variable to docker. Example:
docker run -e PRIVATE_SSH_KEY="$(cat ~/.ssh/id_rsa | perl -pe 's/\n/\\n/')" -d kreisys/docker-ssh-exec-wrapper -server
For more info: https://github.com/mdsol/docker-ssh-exec