Last active
August 29, 2015 14:08
-
-
Save terkhorn/516385080bf201698773 to your computer and use it in GitHub Desktop.
Simple docker-run script
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 | |
### USAGE: | |
### First argument passed to this script is the local volume to mount | |
### to your docker image. Defaults to "/data". | |
### ATTENTION OSX USERS! | |
### IN YOUR .bashrc or .bash_profile, add the following line: | |
### | |
### export DOCKER_NOSUDO=1 | |
### | |
### THIS WILL ALLOW YOU TO AVOID PREFIXING SUDO TO MAC OSX INVOCATION. | |
DATA_DIR=${1-/data} | |
shift | |
if [ -z ${DOCKER_NOSUDO} ]; then CMD="sudo docker"; else CMD="docker"; fi | |
$CMD run -P -v $DATA_DIR:/data -t -i $* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment