Skip to content

Instantly share code, notes, and snippets.

@dergachev
Created May 15, 2014 17:51
Show Gist options
  • Save dergachev/ff7e30475173eac3ccdb to your computer and use it in GitHub Desktop.
Save dergachev/ff7e30475173eac3ccdb to your computer and use it in GitHub Desktop.
Allows SSH Agent forwarding into docker container
# NB: the line with SSH_AUT_SOCK allows SSH Agent forwarding into docker container
# NB: umask 002 makes all newly created files group-writable
docker-run-with-agent:
docker run -t -i \
-v `pwd`/source:/srv/docker-jekyll/source/ \
-v `pwd`/deploy:/srv/docker-jekyll/deploy \
-v `dirname $(SSH_AUTH_SOCK)`:`dirname $(SSH_AUTH_SOCK)` -e SSH_AUTH_SOCK=$(SSH_AUTH_SOCK) \
-p 4000:4000 \
dergachev/docker-jekyll \
/bin/bash -c "umask 002; $(cmd) $(args)"
@dergachev
Copy link
Author

@vasi says this is terrifying

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment