2
0
mirror of https://github.com/linka-cloud/d2vm.git synced 2024-06-16 11:59:53 +00:00
d2vm/templates/centos.Dockerfile
Adphi 8c36d42e06 luks: fix centos Dockerfile template
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
2023-03-01 14:45:27 +01:00

31 lines
863 B
Docker

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-*
RUN yum update -y
RUN yum install -y \
kernel \
systemd \
NetworkManager \
e2fsprogs \
sudo && \
systemctl enable NetworkManager && \
systemctl unmask systemd-remount-fs.service && \
systemctl unmask getty.target && \
cd /boot && \
ln -s $(find . -name 'vmlinuz-*') vmlinuz && \
ln -s $(find . -name 'initramfs-*.img') initrd.img
{{ if .Luks }}
RUN yum install -y cryptsetup && \
dracut --no-hostonly --regenerate-all --force --install="/usr/sbin/cryptsetup"
{{ else }}
RUN dracut --no-hostonly --regenerate-all --force
{{ end }}
{{ if .Password }}RUN echo "root:{{ .Password }}" | chpasswd {{ end }}