File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed
Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ build_with_buildah() {
141141 # For the source: check if there's only one remote, if so use it with get-url
142142 # For revision: rev-parse
143143 set -- build --security-opt=label=disable --cap-add=all --device /dev/fuse \
144+ --pull=newer --layers=true \
144145 --build-arg-file " $argsfile " -v " $( realpath " ${tempdir} /src" ) " :/run/src \
145146 --build-arg VERSION=" ${VERSION} " \
146147 --label org.opencontainers.image.source=" ${source} " \
@@ -169,9 +170,6 @@ build_with_buildah() {
169170 fi
170171
171172 if [ -n " $DIRECT " ]; then
172- # turn on layer caching in the direct case; it wouldn't hurt in the
173- # supermin path, but it'd be a waste of space on the rootfs
174- set -- " $@ " --layers=true
175173 # output to a tag since it's more convenient for development;
176174 # buildah doesn't support doing both at once
177175 # shellcheck disable=SC1090
Original file line number Diff line number Diff line change @@ -613,7 +613,7 @@ runcompose_tree() {
613613
614614# Run with cache disk.
615615runvm_with_cache () {
616- local cache_size=${RUNVM_CACHE_SIZE:- 45G }
616+ local cache_size=${RUNVM_CACHE_SIZE:- 50G }
617617 # "cache2" has an explicit label so we can find it in qemu easily
618618 if [ ! -f " ${workdir} " /cache/cache2.qcow2 ]; then
619619 qemu-img create -f qcow2 cache2.qcow2.tmp " $cache_size "
@@ -773,7 +773,7 @@ if [ -n "\${cachedev}" ]; then
773773 mount -o remount,ro ${workdir} /cache
774774 fsfreeze -f ${workdir} /cache
775775 fsfreeze -u ${workdir} /cache
776- umount ${workdir} /cache
776+ umount -R ${workdir} /cache
777777fi
778778umount ${workdir}
779779/sbin/reboot -f
Original file line number Diff line number Diff line change 5555cachedev=$( blkid -lt LABEL=cosa-cache -o device || true)
5656if [ -n " ${cachedev} " ]; then
5757 mount " ${cachedev} " " ${workdir} " /cache
58+ # Also set up container storage on the cache. We use a symlink
59+ # rather than configuring graphroot in containers/storage.conf
60+ # because when osbuild runs it will use the /etc/containers/storage.conf
61+ # from the host (if using host as buildroot) and then will run out
62+ # of space in "${workdir}"/cache/cache-containers-storage inside
63+ # the bwrap environment. Doing it with a symlink means we can
64+ # still use the cache from the host, but inside osbuild it will
65+ # just get a blank /var/lib/containers to operate on.
66+ mkdir -p " ${workdir} " /cache/cache-containers-storage
67+ rm -rf /var/lib/containers
68+ ln -s " ${workdir} " /cache/cache-containers-storage /var/lib/containers
69+ # Prune all containers and images more than a few days old. Our
70+ # inputs here change daily so this should be reasonable.
71+ podman system prune --all --force --filter until=72h
5872else
5973 echo " No cosa-cache filesystem found!"
6074fi
You can’t perform that action at this time.
0 commit comments