forked from bootc-dev/bootc
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.upgrade-source
More file actions
32 lines (32 loc) · 1.53 KB
/
Copy pathDockerfile.upgrade-source
File metadata and controls
32 lines (32 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Build an image suitable for upgrade testing: takes the published base image
# and adds the minimal dependencies needed by tmt (rsync, nu, etc.)
# so we can boot it in a VM, then upgrade into the locally-built image.
#
# Note: we do NOT pass `cloudinit` to provision-derived.sh because bcvk
# handles SSH key injection itself; cloud-init interferes with that.
ARG base
FROM ${base}
COPY hack/provision-derived.sh hack/packages.txt contrib/packaging/configure-rootfs /run/provision/
ARG variant=ostree
RUN --mount=type=tmpfs,target=/tmp <<EORUN
set -xeuo pipefail
cd /run/provision
# Install nu and tmt dependencies using the same script as the main build,
# but with SKIP_CONFIGS=1 since we don't need LBIs or test kargs in the
# upgrade source image (those come from the image we upgrade into).
SKIP_CONFIGS=1 ./provision-derived.sh
# Ensure a root filesystem type is configured so `bootc install to-disk`
# works for base images that don't ship a default (e.g. Fedora).
# For the ostree variant, configure-rootfs will default to xfs.
./configure-rootfs "${variant}"
# For composefs, rebuild the initramfs to include the bootc dracut module.
# The module's check() returns 255 so it's never auto-included, but it's
# required for composefs root setup during boot.
if [[ "${variant}" == composefs* ]]; then
mkdir -p /etc/dracut.conf.d
echo 'add_dracutmodules+=" bootc "' > /etc/dracut.conf.d/50-bootc-composefs.conf
kver=$(cd /usr/lib/modules && echo *)
dracut --force --kver "$kver" "/usr/lib/modules/$kver/initramfs.img"
fi
rm -rf /run/provision
EORUN