Created
March 7, 2016 03:42
-
-
Save sordina/f5f9f0226db3110311ea 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 | |
set -e | |
echo "$@" | |
if [ -f .dockername ] | |
then | |
N=$(cat .dockername) | |
else | |
N=$(basename $(pwd))-$$ | |
echo $N > .dockername | |
fi | |
echo "Using docker image id $N" 1>&2 | |
if [ -t 0 ] | |
then | |
TTYFLAG=" -t " | |
else | |
TTYFLAG=" " | |
fi | |
docker build -t $N . 1>&2 | |
# docker tag -f $N $N:squashed 1>&2 | |
docker run $TTYFLAG -a stdin -a stdout -a stderr --env-file <(env) -P -i $N $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment