Add option to preserve build container (#160)
This commit is contained in:
parent
4d689a25fd
commit
b4035400ff
2 changed files with 13 additions and 1 deletions
|
@ -139,6 +139,12 @@ continue:
|
|||
CONTINUE=1 ./build-docker.sh
|
||||
```
|
||||
|
||||
After successful build, the build container is by default removed. This may be undesired when making incremental changes to a customized build. To prevent the build script from remove the container add
|
||||
|
||||
```bash
|
||||
PRESERVE_CONTAINER=1 ./build-docker.sh
|
||||
```
|
||||
|
||||
There is a possibility that even when running from a docker container, the
|
||||
installation of `qemu-user-static` will silently fail when building the image
|
||||
because `binfmt-support` _must be enabled on the underlying kernel_. An easy
|
||||
|
|
|
@ -21,6 +21,7 @@ fi
|
|||
|
||||
CONTAINER_NAME=${CONTAINER_NAME:-pigen_work}
|
||||
CONTINUE=${CONTINUE:-0}
|
||||
PRESERVE_CONTAINER=${PRESERVE_CONTAINER:-0}
|
||||
|
||||
if [ "$*" != "" ] || [ -z "${IMG_NAME}" ]; then
|
||||
if [ -z "${IMG_NAME}" ]; then
|
||||
|
@ -33,6 +34,7 @@ Usage:
|
|||
Optional environment arguments: ( =<default> )
|
||||
CONTAINER_NAME=pigen_work set a name for the build container
|
||||
CONTINUE=1 continue from a previously started container
|
||||
PRESERVE_CONTAINER=1 keep build container even on successful build
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
|
@ -75,6 +77,10 @@ fi
|
|||
echo "copying results from deploy/"
|
||||
$DOCKER cp "${CONTAINER_NAME}":/pi-gen/deploy .
|
||||
ls -lah deploy
|
||||
$DOCKER rm -v $CONTAINER_NAME
|
||||
|
||||
# cleanup
|
||||
if [ "$PRESERVE_CONTAINER" != "1" ]; then
|
||||
$DOCKER rm -v $CONTAINER_NAME
|
||||
fi
|
||||
|
||||
echo "Done! Your image(s) should be in deploy/"
|
||||
|
|
Loading…
Reference in a new issue