recovered ssh agent forwarding documentation

The documentation about ssh agent forwarding got lost when osxfs.md was deleted.
So I just want to add the old documentation again at some place where users might look for it.

This is the commit of the old documentation:
4dc6844905 (diff-124453101199ad6385df8981138b4ede623649e8b8b62ee7782be41830034b3a)
This commit is contained in:
Christian Vogel 2021-03-20 19:16:41 +01:00 committed by Sebastiaan van Stijn
parent 8d50f10ae4
commit 86cac4de75
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 26 additions and 0 deletions

View File

@ -44,6 +44,32 @@ syntax for `-p` is `HOST_PORT:CLIENT_PORT`.
See [Proxies](index.md#proxies).
### SSH agent forwarding
Docker Desktop for Mac allows you to use the hosts SSH agent inside a container. To do this:
1. Bind mount the SSH agent socket by adding the following parameter to your `docker run` command:
`--mount type=bind,src=/run/host-services/ssh-auth.sock,target=/run/host-services/ssh-auth.sock`
1. Add the `SSH_AUTH_SOCK` environment variable in your container:
`-e SSH_AUTH_SOCK="/run/host-services/ssh-auth.sock"`
To enable the SSH agent in Docker Compose, add the following flags to your service:
```yaml
services:
web:
image: nginx:alpine
volumes:
- type: bind
source: /run/host-services/ssh-auth.sock
target: /run/host-services/ssh-auth.sock
environment:
- SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock
```
## Known limitations, use cases, and workarounds
Following is a summary of current limitations on the Docker Desktop for {{Arch}}