Docker SSH Agent Forwarding for VSCode Remote Containers #480
Replies: 2 comments
-
I haven't tried this personally but you should be able to get this working by exposing a volume that maps to the secretive agent and then using that volume path for docker-compose.yml version: '3'
services:
app:
container_name: yourcontainer
environment:
- SSH_AUTH_SOCK=/ssh-agent
image: yourapp
volumes:
- /Users/myuser/Library/Containers/com.maxgoedjen.Secretive.SecretAgent/Data/socket.ssh:/ssh-agent Idea taken from https://www.jamesridgway.co.uk/sharing-an-ssh-agent-between-a-host-machine-and-a-docker-container/ |
Beta Was this translation helpful? Give feedback.
-
Based on https://docs.docker.com/desktop/networking/#networking-features-for-mac-and-linux, it looks like it's possible. From my tinkering and lack of success, it seems that care must be taken to get the magic sock path to work: docker/for-mac#4242. |
Beta Was this translation helpful? Give feedback.
-
Hello folks,
I'm using Secretive to store my ssh keys for access, it's an amazing piece of software.
I develop a lot inside VSCode Remote Containers running locally on my laptop. My github SSH keys are stored in Secretive. I can pull/push the code locally. When working from the docker container I cannot pull/push because obviously my SSH agent (that Secretive is running on the laptop) is not available in docker container.
Is there a way to propagate Secretive SSH Agent to be available inside the container and use it there in the same way I use it locally?
Cheers
Beta Was this translation helpful? Give feedback.
All reactions