2
0
mirror of https://github.com/linka-cloud/d2vm.git synced 2026-01-24 10:35:02 +00:00

fix: squash image layers during build

close #75

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2026-01-21 16:34:23 +01:00
parent 113541c1d6
commit 553f7f8d4b
4 changed files with 20 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
FROM {{ .Image }} FROM {{ .Image }} AS rootfs
USER root USER root
@@ -48,3 +48,7 @@ RUN apk add --no-cache \
{{- end }} {{- end }}
grub || true grub || true
{{- end }} {{- end }}
FROM scratch
COPY --from=rootfs / /

View File

@@ -1,4 +1,4 @@
FROM {{ .Image }} FROM {{ .Image }} AS rootfs
USER root USER root
@@ -46,3 +46,7 @@ RUN cd /boot && \
RUN yum clean all && \ RUN yum clean all && \
rm -rf /var/cache/yum rm -rf /var/cache/yum
FROM scratch
COPY --from=rootfs / /

View File

@@ -1,4 +1,4 @@
FROM {{ .Image }} FROM {{ .Image }} AS rootfs
USER root USER root
@@ -77,3 +77,7 @@ RUN mv $(ls -t /boot/vmlinuz-* | head -n 1) /boot/vmlinuz && \
RUN apt-get clean && \ RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
FROM scratch
COPY --from=rootfs / /

View File

@@ -1,4 +1,4 @@
FROM {{ .Image }} FROM {{ .Image }} AS rootfs
USER root USER root
@@ -68,3 +68,7 @@ RUN mv $(ls -t /boot/vmlinuz-* | head -n 1) /boot/vmlinuz && \
RUN apt-get clean && \ RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
FROM scratch
COPY --from=rootfs / /