Skip to content

Instantly share code, notes, and snippets.

@kcmerrill
Last active October 17, 2015 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kcmerrill/ab6efc77f98627bfbdd1 to your computer and use it in GitHub Desktop.
Save kcmerrill/ab6efc77f98627bfbdd1 to your computer and use it in GitHub Desktop.
!#/bin/bash
if [[ $(whoami) == "root" ]]; then
printf "To finalize your yoda installation, simply put this into your ~/.bash_profile as an alias\n\n\nalias "
printf "alias yoda='docker run --rm -ti --name yodaapp -v $HOME/.ssh:$HOME/.ssh -v $HOME/.yoda/shares:/yoda/www/share -v $HOME/.docker:$HOME/.docker -v $HOME/.yoda:$HOME/.yoda -e containerized=true -h=$HOSTNAME -v /var/run/docker.sock:/var/run/docker.sock -v $(if [ $(dirname $PWD) == \"/\" ]; then echo $PWD; else dirname $PWD; fi):$(if [ $(dirname $PWD) == \"/\" ]; then echo $PWD; else dirname $PWD; fi) -w $PWD -u $(id -u $USER) kcmerrill/yoda'";
else
mkdir yoda
cd yoda
printf "FROM kcmerrill/yoda\n\nRUN useradd $(whoami) -u $(id -u $USER)" > Dockerfile
docker build -t yodabin .
printf "To finalize your yoda installation, simply put this into your ~/.bash_profile as an alias\n\n\nalias "
printf "alias yoda='docker run --rm -ti --name yodaapp -v $HOME/.ssh:$HOME/.ssh -v $HOME/.yoda/shares:/yoda/www/share -v $HOME/.docker:$HOME/.docker -v $HOME/.yoda:$HOME/.yoda -e containerized=true -h=$HOSTNAME -v /var/run/docker.sock:/var/run/docker.sock -v $(if [ $(dirname $PWD) == \"/\" ]; then echo $PWD; else dirname $PWD; fi):$(if [ $(dirname $PWD) == \"/\" ]; then echo $PWD; else dirname $PWD; fi) -w $PWD -u $(id -u $USER) yodabin')";
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment