caesarnine / data-science-docker-vscode-template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

persist ssh keys

slackmoehrle opened this issue · comments

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?

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.

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.