Skip to content

Commit 5b34e1a

Browse files
committed
moved instructions to the networking topic
1 parent bef1e69 commit 5b34e1a

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

docker-for-mac/faqs.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -78,24 +78,7 @@ For more information and examples, see
7878

7979
### Can I use an SSH agent inside a container?
8080

81-
Yes, you can use the host’s SSH agent inside a container. To do this:
82-
83-
1. Bind mount the SSH agent socket by adding the following parameter to your `docker run` command:
84-
85-
`-v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock`
86-
87-
1. Add the `SSH_AUTH_SOCK` environment variable in your container:
88-
89-
`-e SSH_AUTH_SOCK="/run/host-services/ssh-auth.sock"`
90-
91-
To enable the SSH agent in Docker Compose, add the following flags to your service:
92-
93-
```
94-
volumes:
95-
- /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock
96-
environment:
97-
- SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock
98-
```
81+
Yes, you can use the host’s SSH agent inside a container. For more information, see [SSH agent forwarding](/docker-for-mac/networking/#ssh-agent-forwarding).
9982

10083
### How do I add custom CA certificates?
10184

docker-for-mac/networking.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,30 @@ $ docker run -p 8000:80 -d nginx
3939
Now, connections to `localhost:8000` are sent to port 80 in the container. The
4040
syntax for `-p` is `HOST_PORT:CLIENT_PORT`.
4141

42+
### SSH agent forwarding
43+
44+
Docker Desktop for {{Arch}} allows you to use the host’s SSH agent inside a container. To do this:
45+
46+
1. Bind mount the SSH agent socket by adding the following parameter to your `docker run` command:
47+
48+
`-v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock`
49+
50+
1. Add the `SSH_AUTH_SOCK` environment variable in your container:
51+
52+
`-e SSH_AUTH_SOCK="/run/host-services/ssh-auth.sock"`
53+
54+
To enable the SSH agent in Docker Compose, add the following flags to your service:
55+
56+
```
57+
volumes:
58+
- /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock
59+
environment:
60+
- SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock
61+
```
62+
4263
### HTTP/HTTPS Proxy Support
4364

44-
See [Proxies](index#proxies).
65+
See [Proxies](/docker-for-mac/index/#proxies).
4566

4667
## Known limitations, use cases, and workarounds
4768

0 commit comments

Comments
 (0)