我正在使用稍微修改过的版本https://github.com/phusion/passenger-docker,在Yosemite上使用boot2docker。
ssh-add -l
...key details
boot2docker up
然后我使用了一些地方都有的命令(例如https://gist.github.com/d11wtq/8699521):
docker run --rm -t -i -v $SSH_AUTH_SOCK:/ssh-agent -e SSH_AUTH_SOCK=/ssh-agent my_image /bin/bash
然而它似乎无效:
root@299212f6fee3:/# ssh-add -l
Could not open a connection to your authentication agent.
root@299212f6fee3:/# eval `ssh-agent -s`
Agent pid 19
root@299212f6fee3:/# ssh-add -l
The agent has no identities.
root@299212f6fee3:/# ssh git@github.com
Warning: Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts.
Permission denied (publickey).