Skip to content

Commit

Permalink
Merge branch 'master' into arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
XECDesign committed Jun 17, 2021
2 parents 071d395 + 4ebe549 commit 95ea0ba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ fix is to ensure `binfmt-support` is installed on the host machine before
starting the `./build-docker.sh` script (or using your own docker build
solution).

### Passing arguments to Docker

When the docker image is run various required command line arguments are provided. For example the system mounts the `/dev` directory to the `/dev` directory within the docker container. If other arguments are required they may be specified in the PIGEN_DOCKER_OPTS environment variable. For example setting `PIGEN_DOCKER_OPTS="--add-host foo:192.168.0.23"` will add '192.168.0.23 foo' to the `/etc/hosts` file in the container. The `--name`
and `--privileged` options are already set by the script and should not be redefined.

## Stage Anatomy

Expand Down
2 changes: 2 additions & 0 deletions build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ if [ "${CONTAINER_EXISTS}" != "" ]; then
--cap-add=ALL \
-v /dev:/dev \
-v /lib/modules:/lib/modules \
${PIGEN_DOCKER_OPTS} \
--volume "${CONFIG_FILE}":/config:ro \
-e "GIT_HASH=${GIT_HASH}" \
--volumes-from="${CONTAINER_NAME}" --name "${CONTAINER_NAME}_cont" \
Expand All @@ -105,6 +106,7 @@ else
--cap-add=ALL \
-v /dev:/dev \
-v /lib/modules:/lib/modules \
${PIGEN_DOCKER_OPTS} \
--volume "${CONFIG_FILE}":/config:ro \
-e "GIT_HASH=${GIT_HASH}" \
pi-gen \
Expand Down
2 changes: 1 addition & 1 deletion stage4/03-bookshelf/00-run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh -e

BOOKSHELF_URL="https://magpi.raspberrypi.org/bookshelf.xml"
GUIDE_URL="$(curl -s "$BOOKSHELF_URL" | awk -F '[<>]' "/<TITLE>Raspberry Pi Beginner's Guide v3<\/TITLE>/ {f=1; next} f==1 && /PDF/ {print \$3; exit}")"
GUIDE_URL="$(curl -s "$BOOKSHELF_URL" | awk -F '[<>]' "/<TITLE>Raspberry Pi Beginner's Guide 4th Edition<\/TITLE>/ {f=1; next} f==1 && /PDF/ {print \$3; exit}")"
OUTPUT="$(basename "$GUIDE_URL" | cut -f1 -d'?')"

if [ ! -f "files/$OUTPUT" ]; then
Expand Down

0 comments on commit 95ea0ba

Please sign in to comment.