'How to mount the beyond agent socket in docker?

I have a project that I run tests in docker, but I also need to be able to pull in dependencies with SSH.



Solution 1:[1]

I was able to mount the agent, but I had to start docker for mac with an environment variable set.

Details here: https://github.com/squareup/beyond-ssh-agent/issues/16

SSH_AUTH_SOCK="/Users/guthrie/Library/Application Support/beyond-ssh-agent/agent.sock" /Applications/Docker.app/Contents/MacOS/Docker

docker run -ti -v /run/host-services/ssh-auth.sock:/tmp/ssh-auth.sock -e SSH_AUTH_SOCK=/tmp/ssh-auth.sock debian bash
root@56b799e36919:/# ssh-add -l
256 SHA256:FkqOi2dAJpw94PGISAWKn2ZHTOJFdQY8LyAl+2Hnw9Q cert (ED25519-CERT)
256 SHA256:FkqOi2dAJpw94PGISAWKn2ZHTOJFdQY8LyAl+2Hnw9Q key (ED25519)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Yaron