2022-04-19 12:01:08 +00: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 16:28:50 +00:00
|
|
|
RUN yum update -y
|
2022-04-19 12:01:08 +00:00
|
|
|
|
2023-09-12 11:59:11 +00:00
|
|
|
# See https://bugzilla.redhat.com/show_bug.cgi?id=1917213
|
2023-02-28 11:01:18 +00:00
|
|
|
RUN yum install -y \
|
|
|
|
kernel \
|
|
|
|
systemd \
|
|
|
|
NetworkManager \
|
2023-09-12 11:59:11 +00:00
|
|
|
{{- if .GrubBIOS }}
|
2023-09-11 13:42:06 +00:00
|
|
|
grub2 \
|
2023-09-12 11:59:11 +00:00
|
|
|
{{- end }}
|
|
|
|
{{- if .GrubEFI }}
|
|
|
|
grub2 grub2-efi-x64 grub2-efi-x64-modules \
|
2023-09-11 13:42:06 +00:00
|
|
|
{{- end }}
|
2023-02-28 11:01:18 +00:00
|
|
|
e2fsprogs \
|
|
|
|
sudo && \
|
2022-04-26 12:59:33 +00:00
|
|
|
systemctl enable NetworkManager && \
|
|
|
|
systemctl unmask systemd-remount-fs.service && \
|
2023-09-12 11:59:11 +00:00
|
|
|
systemctl unmask getty.target && \
|
|
|
|
find /boot -type l -exec rm {} \;
|
2022-04-19 12:01:08 +00:00
|
|
|
|
2023-02-28 16:42:52 +00:00
|
|
|
{{ if .Luks }}
|
|
|
|
RUN yum install -y cryptsetup && \
|
2023-02-28 17:48:12 +00:00
|
|
|
dracut --no-hostonly --regenerate-all --force --install="/usr/sbin/cryptsetup"
|
2023-02-28 16:42:52 +00:00
|
|
|
{{ else }}
|
|
|
|
RUN dracut --no-hostonly --regenerate-all --force
|
|
|
|
{{ end }}
|
|
|
|
|
2022-09-11 18:00:48 +00:00
|
|
|
{{ if .Password }}RUN echo "root:{{ .Password }}" | chpasswd {{ end }}
|
2023-09-12 11:59:11 +00:00
|
|
|
|
|
|
|
{{- if not .Grub }}
|
|
|
|
RUN cd /boot && \
|
|
|
|
mv $(find . -name 'vmlinuz-*') /boot/vmlinuz && \
|
|
|
|
mv $(find . -name 'initramfs-*.img') /boot/initrd.img
|
|
|
|
{{- end }}
|