mirror of
https://github.com/sjlongland/gentoo-docker-builder.git
synced 2025-09-13 18:13:18 +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:
parent
f6f70471e9
commit
4dbc9609fb
12
mkimg.sh
12
mkimg.sh
@ -51,10 +51,18 @@ docker run --rm -v ${SNAPSHOT_DIR}/portage:/usr/portage \
|
|||||||
${REPO}/${BASENAME}-raw:${TAG} \
|
${REPO}/${BASENAME}-raw:${TAG} \
|
||||||
/bin/bash -ex /tmp/work/mkimg-container.sh
|
/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
|
< ${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
|
< ${WORKDIR}/${BASENAME}-rt-${TAG}.tar
|
||||||
|
|
||||||
docker push ${REPO}/${BASENAME}-dev:${TAG}
|
docker push ${REPO}/${BASENAME}-dev:${TAG}
|
||||||
docker push ${REPO}/${BASENAME}-rt:${TAG}
|
docker push ${REPO}/${BASENAME}-rt:${TAG}
|
||||||
docker images -q --filter dangling=true | xargs docker rmi
|
docker images -q --filter dangling=true | xargs docker rmi
|
||||||
|
Loading…
Reference in New Issue
Block a user