1
0
mirror of https://github.com/sjlongland/gentoo-docker-builder.git synced 2025-09-14 02:23:19 +10:00

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.
This commit is contained in:
Stuart Longland 2017-05-21 17:40:00 +10:00
parent f6f70471e9
commit 4dbc9609fb
Signed by: stuartl
GPG Key ID: F954BBBB7948D546

View File

@ -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