File Dockerfile of Package baseos-headers

#!BuildTag: baseos-headers:latest
#

FROM baseos:latest
# This _should_ be OK, becuase if baseos is rebuilt for whatever
# reason, as baseos-headers depends on it, it should be rebuilt
# automatically as well

# Install/Config needed packages
# next line doesn't work because of OBS parsing Dockerfiles to find
# dependenies - it fails with "unresolvable: nothing provides
# kernel-default-devel = $, (got version 5.14.21-150400.24.100
# provided by kernel-default-devel), (got version 5.14.21-150400.24.100.2)
# because the parser isn't running that inline bit of shell.... 
#RUN zypper --non-interactive install kernel-default-devel=$(rpm -q --qf '%{Version}-%{Release}' kernel-default)
RUN zypper --non-interactive in \
    kernel-source \
    gawk \
    gcc \
    python \
    kmod \
    flex \
    bison \
    make

# required for modules_prepare
RUN zypper --non-interactive in \
    openssl-devel \
    libelf-devel \
    bc

RUN cp /boot/config-*-default /usr/src/linux/.config
RUN make -C /usr/src/linux oldconfig
RUN make -C /usr/src/linux modules_prepare
RUN zcat /boot/symvers-*.gz > /usr/src/linux/Module.symvers

# Show installed package version
RUN zypper se -s -i

# Save some space
RUN zypper clean --all && \
    rm -rf /var/log/update* && \
    >/var/log/lastlog && \
    rm -rf /boot/vmlinux*

openSUSE Build Service is sponsored by