summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacen <jacen92@gmail.com>2017-08-31 13:51:08 +0200
committerXECDesign <XECDesign@users.noreply.github.com>2017-09-04 16:43:25 +0100
commit727db0ed63cc0e11e2be54137ce1ef2124387f22 (patch)
treecd4431ab9c61b2c9dc9dfbf78bc69777ef987c0e
parente64ea5bce4abbeb7fff727c439fb35a7b3190646 (diff)
[fixing] docker parts
-rwxr-xr-xbuild-docker.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/build-docker.sh b/build-docker.sh
index c5db00f..eabc8f7 100755
--- a/build-docker.sh
+++ b/build-docker.sh
@@ -13,7 +13,6 @@ if ! $DOCKER ps >/dev/null; then
fi
set -e
-
config_mount=()
if [ -f config ]; then
config_mount=("-v" "$(pwd)/config:/pi-gen/config:ro")
@@ -47,13 +46,13 @@ fi
if [ "$CONTAINER_EXISTS" != "" ] && [ "$CONTINUE" != "1" ]; then
echo "Container $CONTAINER_NAME already exists and you did not specify CONTINUE=1. Aborting."
echo "You can delete the existing container like this:"
- echo " docker rm -v $CONTAINER_NAME"
+ echo " $DOCKER rm -v $CONTAINER_NAME"
exit 1
fi
$DOCKER build -t pi-gen .
if [ "$CONTAINER_EXISTS" != "" ]; then
- trap "echo 'got CTRL+C... please wait 5s';docker stop -t 5 ${CONTAINER_NAME}_cont" SIGINT SIGTERM
+ trap "echo 'got CTRL+C... please wait 5s'; $DOCKER stop -t 5 ${CONTAINER_NAME}_cont" SIGINT SIGTERM
time $DOCKER run --rm --privileged \
--volumes-from="${CONTAINER_NAME}" --name "${CONTAINER_NAME}_cont" \
-e IMG_NAME=${IMG_NAME}\
@@ -63,8 +62,8 @@ if [ "$CONTAINER_EXISTS" != "" ]; then
rsync -av work/*/build.log deploy/" &
wait
else
- trap "echo 'got CTRL+C... please wait 5s'; docker stop -t 5 ${CONTAINER_NAME}" SIGINT SIGTERM
- $DOCKER run --name "${CONTAINER_NAME}" --privileged \
+ trap "echo 'got CTRL+C... please wait 5s'; $DOCKER stop -t 5 ${CONTAINER_NAME}" SIGINT SIGTERM
+ time $DOCKER run --name "${CONTAINER_NAME}" --privileged \
-e IMG_NAME=${IMG_NAME}\
-v "$(pwd)/deploy:/pi-gen/deploy" \
"${config_mount[@]}" \
@@ -73,5 +72,6 @@ else
cd /pi-gen; ./build.sh &&
rsync -av work/*/build.log deploy/" &
wait
+ $DOCKER rm -v $CONTAINER_NAME
fi
echo "Done! Your image(s) should be in deploy/"