Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed running docker script from within pwd containing spaces #76

Merged
merged 1 commit into from
Jun 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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