Use temporary file as Dockerfile

This commit is contained in:
2015-12-05 23:49:27 +01:00
parent 3678cd62cf
commit 05cd56bb3e
3 changed files with 21 additions and 24 deletions

View File

@@ -1,19 +1 @@
FILE=$DOCKER_HOME/images/$1.mk
echo $FILE
if [[ ! -e $FILE ]]; then
DELETE=true
FILE="$(mktemp)"
echo 123
cat <<- EOF > $FILE
include \$(DOCKER_HOME)/build/Makefile
NAME = $1
VERSION = latest
build: $1
EOF
fi
make -f $FILE build
if [ ! -z ${DELETE+x} ]; then
rm $FILE
fi
$DOCKER_HOME/bin/make $1 build

View File

@@ -1 +1,15 @@
make -f $DOCKER_HOME/images/$1.mk $2
FILE=$DOCKER_HOME/images/$1.mk
if [[ ! -e $FILE ]]; then
DELETE=true
FILE="$(mktemp)"
cat <<- EOF > $FILE
include \$(DOCKER_HOME)/build/Makefile
NAME = $1
VERSION = latest
build: $1
EOF
fi
make -f $FILE $2
if [ ! -z ${DELETE+x} ]; then
rm $FILE
fi