2
0
mirror of https://github.com/linka-cloud/d2vm.git synced 2024-07-01 02:39:52 +00:00
d2vm/templates/centos.Dockerfile
Adphi 5b8cad6176
cli: improve flags and commands
docs: add README.md and examples
centos/rhel: fix dracut initramfs

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
2022-04-21 18:28:50 +02:00

18 lines
533 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 sudo
RUN dracut --no-hostonly --regenerate-all --force && \
cd /boot && \
ln -s $(find . -name 'vmlinuz-*') vmlinuz && \
ln -s $(find . -name 'initramfs-*.img') initrd.img
RUN echo "root:{{- if .Password}}{{ .Password}}{{- else}}root{{- end}}" | chpasswd