From 99e65ef998e370097b8016d61b87d3740e295232 Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Tue, 24 Jul 2018 21:38:11 +0100 Subject: [PATCH] tools: Fix mkimage-qcow2-efi Build the final image from scratch instead of the full alpine base. Signed-off-by: Rolf Neugebauer --- tools/mkimage-qcow2-efi/Dockerfile | 35 +++++++++++++++--------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/tools/mkimage-qcow2-efi/Dockerfile b/tools/mkimage-qcow2-efi/Dockerfile index 61e009120..e1acb0e8a 100644 --- a/tools/mkimage-qcow2-efi/Dockerfile +++ b/tools/mkimage-qcow2-efi/Dockerfile @@ -1,19 +1,17 @@ FROM linuxkit/alpine:daed76b8f1d28cdeeee215a95b9671c682a405dc AS grub-build - RUN apk add \ + autoconf \ automake \ - make \ bison \ - gettext \ - flex \ gcc \ + gettext \ git \ - libtool \ + flex \ libc-dev \ + libtool \ linux-headers \ - python3 \ - - autoconf + make \ + python3 # because python is not available RUN ln -s python3 /usr/bin/python @@ -40,22 +38,25 @@ 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 \ + qemu-img \ sfdisk \ sgdisk \ xfsprogs \ - qemu-img \ && 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" ]