Last active
October 17, 2015 04:16
-
-
Save kcmerrill/ab6efc77f98627bfbdd1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!#/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