From 4dbc9609fbfaf1d6f1d538dcfc403c4788e7329a Mon Sep 17 00:00:00 2001 From: Stuart Longland Date: Sun, 21 May 2017 17:40:00 +1000 Subject: [PATCH] mkimg.sh: Declare /usr/portage and /var/lib/layman mountpoints. This allows us to ship a "development" image that has all the binaries and Portage tree embedded, and a "runtime" image without. To install a package, we spin up the "development" image into a running container and let it build any additional packages needed, then we can spin up the runtime using `--volumes-from` pointing at the development container before running `emerge -K` to install them. After that is done, `docker commit` will commit that instance of the runtime image to a new image which is our bundled package container. --- mkimg.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mkimg.sh b/mkimg.sh index 339948f..80a249e 100644 --- a/mkimg.sh +++ b/mkimg.sh @@ -51,10 +51,18 @@ docker run --rm -v ${SNAPSHOT_DIR}/portage:/usr/portage \ ${REPO}/${BASENAME}-raw:${TAG} \ /bin/bash -ex /tmp/work/mkimg-container.sh -docker import - ${REPO}/${BASENAME}-dev:${TAG} \ +docker import \ + -c "VOLUME /usr/portage" \ + -c "VOLUME /var/lib/layman" \ + - ${REPO}/${BASENAME}-dev:${TAG} \ < ${WORKDIR}/${BASENAME}-dev-${TAG}.tar -docker import - ${REPO}/${BASENAME}-rt:${TAG} \ + +docker import - \ + -c "VOLUME /usr/portage" \ + -c "VOLUME /var/lib/layman" \ + ${REPO}/${BASENAME}-rt:${TAG} \ < ${WORKDIR}/${BASENAME}-rt-${TAG}.tar + docker push ${REPO}/${BASENAME}-dev:${TAG} docker push ${REPO}/${BASENAME}-rt:${TAG} docker images -q --filter dangling=true | xargs docker rmi