update-kernel/Dockerfile
Vitaly Chikunov c8da9f830f update-kernel: '--headers' to install kernel-headers
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
2022-04-08 04:31:17 +03:00

48 lines
1.5 KiB
Docker

FROM alt:sisyphus
# Trace execution.
SHELL ["/bin/bash", "-xec"]
ARG branch=sisyphus
ARG repo=http://ftp.altlinux.org/pub/distributions/archive/$branch/date
ARG a=2022/01/01
ARG b=2022/02/02
# Initialize the system and start from some arbitrary date.
# update-kernel is installed just for dependencies.
RUN \
echo "rpm $repo/$a/ x86_64 classic" > /etc/apt/sources.list && \
echo "rpm $repo/$a/ noarch classic" >> /etc/apt/sources.list && \
rm /etc/apt/sources.list.d/*.list && \
apt-get update && \
apt-get install -y update-kernel toilet dkms
# Overwrite update-kernel with the local copy.
# Docker will notice and rebuild if files are changed.
COPY update-kernel remove-old-kernels /usr/sbin/
# Install base kernel for upgrading later.
# Check if the kernel appeared.
RUN toilet -w 150 First install && \
update-kernel -v -t std-def -f --headers && \
ls -l /boot/vmlinuz /boot/vmlinuz-std-def /boot/initrd.img /boot/initrd-std-def.img && \
ls -l /boot/$(readlink /boot/vmlinuz)
# Second call should succeed not installing anything, thus
# no -f for it to fail if it will try to install something.
RUN update-kernel -v -t std-def
# Forward to some future.
RUN \
echo "rpm $repo/$b/ x86_64 classic" > /etc/apt/sources.list && \
echo "rpm $repo/$b/ noarch classic" >> /etc/apt/sources.list && \
apt-get update
# Update kernel.
RUN toilet Upgrading && \
update-kernel -v -t std-def -f && \
update-kernel -v -l && \
ls -la /boot
# There now should be two kernels.