diff --git a/kernel/Dockerfile b/kernel/Dockerfile index 4c7308eec..fb4998d45 100644 --- a/kernel/Dockerfile +++ b/kernel/Dockerfile @@ -45,6 +45,8 @@ ARG DEBUG # build kernels without patches. COPY / / +RUN mkdir -p /out/src + # Download and verify kernel # PGP keys: 589DA6B1 (greg@kroah.com) & 6092693E (autosigner@kernel.org) & 00411886 (torvalds@linux-foundation.org) RUN KERNEL_MAJOR=$(echo ${KERNEL_VERSION} | cut -d . -f 1) && \ @@ -61,10 +63,8 @@ RUN KERNEL_MAJOR=$(echo ${KERNEL_VERSION} | cut -d . -f 1) && \ xz -d linux-${KERNEL_VERSION}.tar.xz && \ curl -fsSLO ${KERNEL_PGP2_SIGN} && \ gpg2 --verify linux-${KERNEL_VERSION}.tar.sign linux-${KERNEL_VERSION}.tar && \ - cat linux-${KERNEL_VERSION}.tar | tar --absolute-names -x && mv /linux-${KERNEL_VERSION} /linux - - -RUN mkdir -p /out/src + cat linux-${KERNEL_VERSION}.tar | tar --absolute-names -x && mv /linux-${KERNEL_VERSION} /linux && \ + printf "KERNEL_SOURCE=${KERNEL_SOURCE}\n" > /out/kernel-source-info WORKDIR /tmp # Download Intel ucode, create a CPIO archive for it, and keep it in the build context @@ -103,8 +103,6 @@ RUN set -e && \ done; \ fi - - # Save kernel source RUN tar cJf /out/src/linux.tar.xz /linux @@ -196,7 +194,6 @@ RUN DVER=$(basename $(find /tmp/kernel-modules/lib/modules/ -mindepth 1 -maxdept tar cf - -T - | (cd $dir; tar xf -) && \ ( cd /tmp && tar cf /out/kernel-dev.tar usr/src ) -RUN printf "KERNEL_SOURCE=${KERNEL_SOURCE}\n" > /out/kernel-source-info RUN printf "${BUILD_IMAGE}" > /out/kernel-builder LABEL org.mobyproject.linuxkit.kernel.buildimage ${BUILD_IMAGE}