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 \
|
|
|
|
{{- if .Luks }}
|
|
|
|
cryptsetup \
|
|
|
|
{{- end }}
|
|
|
|
sudo && \
|
2022-04-26 12:59:33 +00:00
|
|
|
systemctl enable NetworkManager && \
|
|
|
|
systemctl unmask systemd-remount-fs.service && \
|
|
|
|
systemctl unmask getty.target
|
2022-04-19 12:01:08 +00:00
|
|
|
|
2023-02-28 11:01:18 +00:00
|
|
|
RUN dracut --no-hostonly --regenerate-all --force {{ if .Luks }}--install="/usr/sbin/cryptsetup"{{ end }}&& \
|
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
|
|
|
|
|
2022-09-11 18:00:48 +00:00
|
|
|
{{ if .Password }}RUN echo "root:{{ .Password }}" | chpasswd {{ end }}
|