Hi, Thank you for working on bootc!
Is there a way how to build base image from scratch with custom kernel? I’m following the tutorial from From scratch Fedora/CentOS bootc base container images :: Fedora Docs and trying to remove the kernel and install my custom one without any luck (system is not booting - problem on screenshot). Could you help me what am I doing wrong? Thank you for your answer.
My Containerfile:
FROM quay.io/centos-bootc/centos-bootc:stream10 as builder
# Add custom repos
RUN rm -rf /etc/yum.repos.d/*
COPY ./my.repo /etc/yum.repos.d/
COPY ./RPM-GPG-KEY /etc/pki/rpm-gpg/
# Generate the minimal root filesystem
RUN /usr/libexec/bootc-base-imagectl build-rootfs --manifest=minimal /target-rootfs
# Now start building our image here, inheriting that minimal base.
FROM scratch
COPY --from=builder /target-rootfs/ /
RUN rm -rf /etc/yum.repos.d/*
COPY ./my.repo /etc/yum.repos.d/
COPY ./RPM-GPG-KEY /etc/pki/rpm-gpg/
RUN <<EORUN
set -xeuo pipefail
# Remove all other kernels and clean up /usr/lib/modules
dnf -y remove kernel kernel-core kernel-modules kernel-modules-core || true
rm -rf /usr/lib/modules/*
dnf -y install kernel-ml
dnf -y install openssh-server
systemctl enable sshd
# Clean up unnecessary files
rm -rf /usr/etc
dnf clean all
rm /var/{log,cache,lib}/* -rf
bootc container lint
EORUN
LABEL containers.bootc 1
LABEL ostree.bootable 1
STOPSIGNAL SIGRTMIN+3
CMD ["/sbin/init"]
Booting screenshot: