tools: Fix mkimage-iso-efi

Build the final image from SCRATCH instead of the alpine base.
Should be a lot smaller now.

Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
This commit is contained in:
Rolf Neugebauer 2018-07-24 21:35:21 +01:00
parent 4ca0458526
commit 47bff24b94

View File

@ -1,5 +1,4 @@
FROM linuxkit/alpine:daed76b8f1d28cdeeee215a95b9671c682a405dc AS grub-build
RUN apk add \
automake \
make \
@ -39,19 +38,22 @@ RUN mkdir /grub-lib && \
;; \
esac
FROM linuxkit/alpine:daed76b8f1d28cdeeee215a95b9671c682a405dc AS make-img
RUN \
apk update && apk upgrade && \
apk add --no-cache \
FROM linuxkit/alpine:daed76b8f1d28cdeeee215a95b9671c682a405dc AS mirror
RUN mkdir -p /out/etc/apk && cp -r /etc/apk/* /out/etc/apk/
RUN apk add --no-cache --initdb -p /out \
alpine-baselayout \
binutils \
busybox \
dosfstools \
libarchive-tools \
binutils \
mtools \
xorriso \
&& true
RUN mv /out/etc/apk/repositories.upstream /out/etc/apk/repositories
COPY . .
FROM scratch
WORKDIR /
COPY --from=mirror /out/ /
COPY --from=grub-build /grub-lib/BOOT*.EFI /usr/local/share/
COPY . .
ENTRYPOINT [ "/make-efi" ]