Docker Community Forums

Share and learn in the Docker community.

Can we re-use the OSX ssh-agent socket in a container?

We really need support for this to pull from private repos that require SSH authentication.

1 Like

Any updates on this? Or new work-arounds?

1 Like

Still waiting on this. It’s quite crippling to not have a solution.

1 Like

+1 I’m waiting on this…

1 Like

Lack of proper socket support prevents us from for using Docker in our environment. Any updates on this?


Any news on this? I’m blocked if i can’t share the agent.

Can we get a link to github issues or other issue tracker around this issue? Are there any other workarounds available? docker-ssh-agent-forward is extremely unwieldy.


1 Like

There is an official solution using magic path /run/host-services/ssh-auth.sock.

That works for Dockerfile and docker-compose if a user is root and with some adjustments in Dockerfile for non-root.
When a user is non-root in the image and we use it in docker-compose with a mounted socket in volume, as explained
the issue is that socket is owned by root and not accessible by the inner user from the image.

Any potential solution with chown or chmod didn’t work.

The idea is not to use root when pulling private repos as dependencies in image build process and during development in docker-compose.yml.

Any advice on how to proceed in this case?