Skip to content

Commit

Permalink
Fixed running docker script from within pwd containing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Phillips authored and XECDesign committed Jun 27, 2017
1 parent 50e5c01 commit c926384
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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;
Expand All @@ -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 &&
Expand Down

0 comments on commit c926384

Please sign in to comment.