caesarnine / data-science-docker-vscode-template

163 stars 35 forks source link

persist ssh keys #3

Closed slackmoehrle closed 5 years ago

slackmoehrle commented 5 years ago

What options does one have to persist ssh keys in ~/.ssh? i.e commits and pushes to github repos? I guess I could symlink ~/.ssh to /data/.ssh so that it persists each time. Any better way?

caesarnine commented 5 years ago

You should be able to just pass in your .ssh folder as a bind-mount volume - so in the docker run command add in -v /home/slackmoehrle/.ssh:/root/.ssh:ro (note the :ro portion marks it as read only, remove that if necessary).

I haven't tested it yet but that should allow you to use git commands as you normally would even within the container itself.

slackmoehrle commented 5 years ago

Perfect. It works. If anyone else needs this one thing I ran into was trying to shortcut my home directory with ~ instead of /Users/username.