diff options
| author | Claude Warren <claude@xenei.com> | 2021-06-16 14:32:21 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-16 14:32:21 +0100 |
| commit | f271ce26e91434e7607137f309c2411aa345f7c5 (patch) | |
| tree | a42fcffbe445d12d827524d3ccc444fabed4ab38 | |
| parent | dcfd74d7d1fa293065ac6d565711e9ff891fe2b8 (diff) | |
Added PIGEN_DOCKER_OPTS to build-docker.sh (#521)
| -rw-r--r-- | README.md | 4 | ||||
| -rwxr-xr-x | build-docker.sh | 2 |
2 files changed, 6 insertions, 0 deletions
@@ -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 diff --git a/build-docker.sh b/build-docker.sh index 5d31f86..9538a8b 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -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" \ @@ -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 \ |
