FROM fedora:43
RUN --mount=type=cache,target=/var/cache/libdnf5 <<EOF
    set -eux

    dnf --setopt keepcache=1 install --allowerasing -y \
        composefs \
        dosfstools \
        kernel \
        openssh-server \
        skopeo \
        strace \
        util-linux \
        systemd
EOF

# --- Everything above this line should hopefully stay cached ---

COPY cfsctl /usr/bin
COPY extra /
COPY test-thing.workarounds/fedora-42 /
RUN --mount=type=cache,target=/var/cache/libdnf5 <<EOF
    kernel-install add-all
    systemctl enable systemd-networkd
    passwd -d root
    mkdir /sysroot
EOF
