INCATools / ontology-development-kit

Bootstrap an OBO Library ontology
http://incatools.github.io/ontology-development-kit/
BSD 3-Clause "New" or "Revised" License
219 stars 54 forks source link

Make possible to use user’s SSH keys from within the ODK container #852

Closed gouttegd closed 1 year ago

gouttegd commented 1 year ago

Cool people don’t use Git with passwords, they use it with a SSH key pair instead. For those people, it should be possible to use Git commands that require a SSH key from within the container.

Assuming most people using a SSH key pair are also using a SSH agent, all we would have to do is to forward the agent’s socket into the container:

$ docker run -v $SSH_AUTH_SOCK:/ssh-auth.sock -e SSH_AUTH_SOCK=/ssh-auth.sock [other docker run options and arguments…]

This works fine at least on GNU/Linux. Unfortunately it doesn’t work on macOS, where a special workaround exists instead:

$ docker run -v /run/host-services/ssh-auth.sock:/run/host-services/ssh-auth.sock -e SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock [other docker run options and arguments…]

A simpler option is to just bind the user’s ~/.ssh directory, but this will only work for simple setups where an agent is not necessary – and many users may not like the idea of exposing their SSH private key to the ODK container, not matter how much they trust the ODK…