2022-04-19 12:01:08 +00:00
|
|
|
FROM {{ .Image }}
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
|
|
|
RUN apk update --no-cache && \
|
|
|
|
apk add \
|
|
|
|
util-linux \
|
|
|
|
linux-virt \
|
2023-02-22 16:26:32 +00:00
|
|
|
{{- if ge .Release.VersionID "3.17" }}
|
2023-02-15 09:20:37 +00:00
|
|
|
busybox-openrc \
|
|
|
|
busybox-mdev-openrc \
|
|
|
|
busybox-extras-openrc \
|
|
|
|
busybox-mdev-openrc \
|
2023-02-22 16:26:32 +00:00
|
|
|
{{- else }}
|
2022-04-19 12:01:08 +00:00
|
|
|
busybox-initscripts \
|
2023-02-22 16:26:32 +00:00
|
|
|
{{- end }}
|
2023-09-11 16:45:42 +00:00
|
|
|
openrc && \
|
|
|
|
find /boot -type l -exec rm {} \;
|
2022-04-19 12:01:08 +00:00
|
|
|
|
|
|
|
RUN for s in bootmisc hostname hwclock modules networking swap sysctl urandom syslog; do rc-update add $s boot; done
|
|
|
|
RUN for s in devfs dmesg hwdrivers mdev; do rc-update add $s sysinit; done
|
|
|
|
|
2022-09-11 18:00:48 +00:00
|
|
|
{{ if .Password }}RUN echo "root:{{ .Password }}" | chpasswd {{ end }}
|
2022-04-19 12:01:08 +00:00
|
|
|
|
2022-08-08 15:58:49 +00:00
|
|
|
{{ if eq .NetworkManager "ifupdown"}}
|
|
|
|
RUN apk add --no-cache ifupdown-ng
|
|
|
|
RUN mkdir -p /etc/network && printf '\
|
|
|
|
auto eth0\n\
|
|
|
|
allow-hotplug eth0\n\
|
|
|
|
iface eth0 inet dhcp\n\
|
|
|
|
' > /etc/network/interfaces
|
|
|
|
{{ end }}
|
2023-02-23 14:02:12 +00:00
|
|
|
|
|
|
|
{{- if .Luks }}
|
2023-02-28 16:42:52 +00:00
|
|
|
RUN apk add --no-cache cryptsetup && \
|
|
|
|
source /etc/mkinitfs/mkinitfs.conf && \
|
2023-02-23 14:02:12 +00:00
|
|
|
echo "features=\"${features} cryptsetup\"" > /etc/mkinitfs/mkinitfs.conf && \
|
|
|
|
mkinitfs $(ls /lib/modules)
|
|
|
|
{{- end }}
|
2023-09-11 13:42:06 +00:00
|
|
|
|
|
|
|
{{- if .Grub }} \
|
|
|
|
RUN apk add --no-cache grub grub-bios
|
|
|
|
{{- end }}
|