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-02-28 11:01:18 +00:00
|
|
|
RUN yum install -y \
|
|
|
|
kernel \
|
|
|
|
systemd \
|
|
|
|
NetworkManager \
|
|
|
|
e2fsprogs \
|
|
|
|
sudo && \
|
2022-04-26 12:59:33 +00:00
|
|
|
systemctl enable NetworkManager && \
|
|
|
|
systemctl unmask systemd-remount-fs.service && \
|
2023-02-28 16:42:52 +00:00
|
|
|
systemctl unmask getty.target && \
|
2022-04-21 16:28:50 +00:00
|
|
|
cd /boot && \
|
2022-04-19 12:01:08 +00:00
|
|
|
ln -s $(find . -name 'vmlinuz-*') vmlinuz && \
|
|
|
|
ln -s $(find . -name 'initramfs-*.img') initrd.img
|
|
|
|
|
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 }}
|