Last active
November 23, 2022 16:35
-
-
Save djmaze/8c3855ebca9f84cc9696e410e6b314bf to your computer and use it in GitHub Desktop.
Use docker-ssh-agent-forward with Docker Compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
app: | |
image: gcea/ssh-client | |
environment: | |
SSH_AUTH_SOCK: /ssh-agent/ssh-agent.sock | |
volumes: | |
- ssh-agent:/ssh-agent | |
volumes: | |
ssh-agent: | |
external: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ pinata-ssh-forward | |
ssh-agent | |
Agent forwarding successfully started. | |
Run "pinata-ssh-mount" to get a command-line fragment that | |
can be added to "docker run" to mount the SSH agent socket. | |
For example: | |
docker run -it `pinata-ssh-mount` ocaml/opam ssh [email protected] | |
$ docker-compose run --rm app ssh -o StrictHostKeyChecking=no [email protected] | |
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts. | |
PTY allocation request failed on channel 0 | |
Hi djmaze! You've successfully authenticated, but GitHub does not provide shell access. | |
Connection to github.com closed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment