2022-04-19 14:01:08 +02:00
|
|
|
FROM {{ .Image }}
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
|
|
|
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && \
|
|
|
|
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
|
|
|
|
|
2022-04-21 18:28:50 +02:00
|
|
|
RUN yum update -y
|
2022-04-19 14:01:08 +02:00
|
|
|
|
2023-02-28 12:01:18 +01:00
|
|
|
RUN yum install -y \
|
|
|
|
kernel \
|
|
|
|
systemd \
|
|
|
|
NetworkManager \
|
|
|
|
e2fsprogs \
|
|
|
|
sudo && \
|
2022-04-26 14:59:33 +02:00
|
|
|
systemctl enable NetworkManager && \
|
|
|
|
systemctl unmask systemd-remount-fs.service && \
|
2023-02-28 17:42:52 +01:00
|
|
|
systemctl unmask getty.target && \
|
2022-04-21 18:28:50 +02:00
|
|
|
cd /boot && \
|
2022-04-19 14:01:08 +02:00
|
|
|
ln -s $(find . -name 'vmlinuz-*') vmlinuz && \
|
|
|
|
ln -s $(find . -name 'initramfs-*.img') initrd.img
|
|
|
|
|
2023-02-28 17:42:52 +01:00
|
|
|
{{ if .Luks }}
|
|
|
|
RUN yum install -y cryptsetup && \
|
2023-02-28 18:48:12 +01:00
|
|
|
dracut --no-hostonly --regenerate-all --force --install="/usr/sbin/cryptsetup"
|
2023-02-28 17:42:52 +01:00
|
|
|
{{ else }}
|
|
|
|
RUN dracut --no-hostonly --regenerate-all --force
|
|
|
|
{{ end }}
|
|
|
|
|
2022-09-11 20:00:48 +02:00
|
|
|
{{ if .Password }}RUN echo "root:{{ .Password }}" | chpasswd {{ end }}
|