mirror of
https://github.com/linka-cloud/d2vm.git
synced 2025-09-16 03:31:45 +00:00
@@ -2,13 +2,18 @@ FROM {{ .Image }}
|
||||
|
||||
USER root
|
||||
|
||||
{{ if le .Release.VersionID "14.04" }}
|
||||
# restore initctl
|
||||
RUN rm /sbin/initctl && dpkg-divert --rename --remove /sbin/initctl
|
||||
# setup ttyS0
|
||||
RUN cp /etc/init/tty1.conf /etc/init/ttyS0.conf && sed -i s/tty1/ttyS0/g /etc/init/ttyS0.conf
|
||||
{{ end }}
|
||||
|
||||
RUN ARCH="$([ "$(uname -m)" = "x86_64" ] && echo amd64 || echo arm64)"; \
|
||||
apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
|
||||
linux-image-virtual \
|
||||
initramfs-tools \
|
||||
systemd-sysv \
|
||||
systemd \
|
||||
{{- if .Grub }}
|
||||
grub-common \
|
||||
grub2-common \
|
||||
@@ -21,18 +26,29 @@ RUN ARCH="$([ "$(uname -m)" = "x86_64" ] && echo amd64 || echo arm64)"; \
|
||||
{{- end }}
|
||||
dbus \
|
||||
isc-dhcp-client \
|
||||
iproute2 \
|
||||
iputils-ping && \
|
||||
find /boot -type l -exec rm {} \;
|
||||
|
||||
{{ if gt .Release.VersionID "14.04" }}
|
||||
RUN ARCH="$([ "$(uname -m)" = "x86_64" ] && echo amd64 || echo arm64)"; \
|
||||
apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
|
||||
iproute2 \
|
||||
{{ end }}
|
||||
|
||||
{{ if gt .Release.VersionID "16.04" }}
|
||||
RUN ARCH="$([ "$(uname -m)" = "x86_64" ] && echo amd64 || echo arm64)"; \
|
||||
apt-get update && \
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
|
||||
systemd-sysv \
|
||||
systemd
|
||||
RUN systemctl preset-all
|
||||
{{ end }}
|
||||
|
||||
{{ if .Password }}RUN echo "root:{{ .Password }}" | chpasswd {{ end }}
|
||||
|
||||
{{ if eq .NetworkManager "netplan" }}
|
||||
RUN apt install -y netplan.io
|
||||
RUN apt-get install -y netplan.io
|
||||
RUN mkdir -p /etc/netplan && printf '\
|
||||
network:\n\
|
||||
version: 2\n\
|
||||
@@ -47,7 +63,7 @@ network:\n\
|
||||
- 8.8.4.4\n\
|
||||
' > /etc/netplan/00-netcfg.yaml
|
||||
{{ else if eq .NetworkManager "ifupdown"}}
|
||||
RUN if [ -z "$(apt-cache madison ifupdown-ng 2> /dev/nul)" ]; then apt install -y ifupdown; else apt install -y ifupdown-ng; fi
|
||||
RUN if [ -z "$(apt-cache madison ifupdown-ng 2> /dev/nul)" ]; then apt-get install -y ifupdown; else apt-get install -y ifupdown-ng; fi
|
||||
RUN mkdir -p /etc/network && printf '\
|
||||
auto eth0\n\
|
||||
allow-hotplug eth0\n\
|
||||
|
Reference in New Issue
Block a user