summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Phillips <thomas@teknique.com>2017-06-02 16:33:08 +1200
committerXECDesign <XECDesign@users.noreply.github.com>2017-06-27 13:08:08 +0100
commitc92638438a59fbc705eb9aff16a4a1c249fac91c (patch)
tree815b8d44f531e88a0c47b790c43445b7ac726d42
parent50e5c01f573254410839dd86ca8407998b565983 (diff)
Fixed running docker script from within pwd containing spaces
-rwxr-xr-xbuild-docker.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/build-docker.sh b/build-docker.sh
index 94b2dc0..6d0b2d0 100755
--- a/build-docker.sh
+++ b/build-docker.sh
@@ -12,9 +12,9 @@ if ! $DOCKER ps >/dev/null; then
fi
set -e
-config_mount=
+config_mount="/dev/null:/dev/null"
if [ -f config ]; then
- config_mount="-v $(pwd)/config:/pi-gen/config:ro"
+ config_mount="$(pwd)/config:/pi-gen/config:ro"
source config
fi
@@ -54,6 +54,7 @@ if [ "$CONTAINER_EXISTS" != "" ]; then
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}\
pi-gen \
bash -e -o pipefail -c "dpkg-reconfigure qemu-user-static &&
cd /pi-gen; ./build.sh;
@@ -62,8 +63,9 @@ if [ "$CONTAINER_EXISTS" != "" ]; then
else
trap "echo 'got CTRL+C... please wait 5s'; docker stop -t 5 ${CONTAINER_NAME}" SIGINT SIGTERM
$DOCKER run --name "${CONTAINER_NAME}" --privileged \
- -v $(pwd)/deploy:/pi-gen/deploy \
- ${config_mount} \
+ -e IMG_NAME=${IMG_NAME}\
+ -v "$(pwd)/deploy:/pi-gen/deploy" \
+ -v "${config_mount}" \
pi-gen \
bash -e -o pipefail -c "dpkg-reconfigure qemu-user-static &&
cd /pi-gen; ./build.sh &&