Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
FROM docker.io/archlinux/archlinux:latest AS builder
RUN pacman -Syu --noconfirm make git rust go-md2man ostree glibc pkgconf
WORKDIR /build/bootc
RUN git clone "https://github.com/bootc-dev/bootc.git" . && \
make bin install-all DESTDIR=/output

FROM docker.io/archlinux/archlinux:latest

# Move everything from `/var` to `/usr/lib/sysimage` so behavior around pacman remains the same on `bootc usroverlay`'d systems
Expand All @@ -8,16 +14,13 @@ RUN pacman -Syu --noconfirm

RUN pacman -Sy --noconfirm base dracut linux linux-firmware ostree btrfs-progs e2fsprogs xfsprogs dosfstools skopeo dbus dbus-glib glib2 ostree shadow && pacman -S --clean --noconfirm

COPY --from=builder /output /

# https://github.com/bootc-dev/bootc/issues/1801
RUN --mount=type=tmpfs,dst=/tmp --mount=type=tmpfs,dst=/root \
pacman -S --noconfirm make git rust go-md2man && \
git clone "https://github.com/bootc-dev/bootc.git" /tmp/bootc && \
make -C /tmp/bootc bin install-all && \
printf "systemdsystemconfdir=/etc/systemd/system\nsystemdsystemunitdir=/usr/lib/systemd/system\n" | tee /usr/lib/dracut/dracut.conf.d/30-bootcrew-fix-bootc-module.conf && \
printf 'reproducible=yes\nhostonly=no\ncompress=zstd\nadd_dracutmodules+=" ostree bootc "' | tee "/usr/lib/dracut/dracut.conf.d/30-bootcrew-bootc-container-build.conf" && \
dracut --force "$(find /usr/lib/modules -maxdepth 1 -type d | grep -v -E "*.img" | tail -n 1)/initramfs.img" && \
pacman -Rns --noconfirm make git rust go-md2man && \
pacman -S --clean --noconfirm
dracut --force "$(find /usr/lib/modules -maxdepth 1 -type d | grep -v -E "*.img" | tail -n 1)/initramfs.img"

# Necessary for general behavior expected by image-based systems
RUN sed -i 's|^HOME=.*|HOME=/var/home|' "/etc/default/useradd" && \
Expand Down