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() {
141
141
# For the source: check if there's only one remote, if so use it with get-url
142
142
# For revision: rev-parse
143
143
set -- build --security-opt=label=disable --cap-add=all --device /dev/fuse \
144
+ --pull=newer --layers=true \
144
145
--build-arg-file " $argsfile " -v " $( realpath " ${tempdir} /src" ) " :/run/src \
145
146
--build-arg VERSION=" ${VERSION} " \
146
147
--label org.opencontainers.image.source=" ${source} " \
@@ -169,9 +170,6 @@ build_with_buildah() {
169
170
fi
170
171
171
172
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
175
173
# output to a tag since it's more convenient for development;
176
174
# buildah doesn't support doing both at once
177
175
# shellcheck disable=SC1090
Original file line number Diff line number Diff line change @@ -613,7 +613,7 @@ runcompose_tree() {
613
613
614
614
# Run with cache disk.
615
615
runvm_with_cache () {
616
- local cache_size=${RUNVM_CACHE_SIZE:- 45G }
616
+ local cache_size=${RUNVM_CACHE_SIZE:- 50G }
617
617
# "cache2" has an explicit label so we can find it in qemu easily
618
618
if [ ! -f " ${workdir} " /cache/cache2.qcow2 ]; then
619
619
qemu-img create -f qcow2 cache2.qcow2.tmp " $cache_size "
@@ -773,7 +773,7 @@ if [ -n "\${cachedev}" ]; then
773
773
mount -o remount,ro ${workdir} /cache
774
774
fsfreeze -f ${workdir} /cache
775
775
fsfreeze -u ${workdir} /cache
776
- umount ${workdir} /cache
776
+ umount -R ${workdir} /cache
777
777
fi
778
778
umount ${workdir}
779
779
/sbin/reboot -f
Original file line number Diff line number Diff line change 55
55
cachedev=$( blkid -lt LABEL=cosa-cache -o device || true)
56
56
if [ -n " ${cachedev} " ]; then
57
57
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
58
72
else
59
73
echo " No cosa-cache filesystem found!"
60
74
fi
You can’t perform that action at this time.
0 commit comments