Add info on ssh agent usage (#10184)

* Add info on ssh agent usage

* moved instructions to the networking topic

* address review comments

* removed an extra line in the faq
This commit is contained in:
Usha Mandya 2020-01-30 17:24:37 +00:00 committed by GitHub
parent 23b2393809
commit 4dc6844905
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 1 deletions

View File

@ -76,6 +76,10 @@ We recommend that you publish a port, or connect from another container. You can
For more information and examples, see For more information and examples, see
[I want to connect to a container from the Mac](networking.md#i-want-to-connect-to-a-container-from-the-mac) in the [Networking](/docker-for-mac/networking/) topic. [I want to connect to a container from the Mac](networking.md#i-want-to-connect-to-a-container-from-the-mac) in the [Networking](/docker-for-mac/networking/) topic.
### Can I use an SSH agent inside a container?
Yes, you can use the hosts SSH agent inside a container. For more information, see [SSH agent forwarding](/docker-for-mac/osxfs/#ssh-agent-forwarding).
### How do I add custom CA certificates? ### How do I add custom CA certificates?
Docker Desktop supports all trusted certificate authorities (CAs) (root or intermediate). For more information on adding server and client side certs, see Docker Desktop supports all trusted certificate authorities (CAs) (root or intermediate). For more information on adding server and client side certs, see

View File

@ -41,7 +41,7 @@ syntax for `-p` is `HOST_PORT:CLIENT_PORT`.
### HTTP/HTTPS Proxy Support ### HTTP/HTTPS Proxy Support
See [Proxies](index#proxies). See [Proxies](/docker-for-mac/index/#proxies).
## Known limitations, use cases, and workarounds ## Known limitations, use cases, and workarounds

View File

@ -153,6 +153,32 @@ Extended attributes are not yet supported.
`osxfs` does not use OSXFUSE. `osxfs` does not run under, inside, or `osxfs` does not use OSXFUSE. `osxfs` does not run under, inside, or
between macOS userspace processes and the macOS kernel. between macOS userspace processes and the macOS kernel.
### 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
```
### Performance issues, solutions, and roadmap ### Performance issues, solutions, and roadmap
> See **[Performance tuning for volume mounts (shared filesystems)](osxfs-caching.md)** > See **[Performance tuning for volume mounts (shared filesystems)](osxfs-caching.md)**