From 35070c03f79762b4b7d90c60274a7ee122730734 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Mon, 12 Sep 2016 00:41:04 +0100 Subject: [PATCH] Use a base image for building kernel As we do not have a simple way to hash Debian, use the Docker sha256 until we switch to Alpine. Signed-off-by: Justin Cormack --- alpine/base/debian-build-kernel/Dockerfile | 24 ++++++++++++++++ alpine/base/debian-build-kernel/Makefile | 10 +++++++ alpine/kernel/Dockerfile | 33 ++++------------------ 3 files changed, 40 insertions(+), 27 deletions(-) create mode 100644 alpine/base/debian-build-kernel/Dockerfile create mode 100644 alpine/base/debian-build-kernel/Makefile diff --git a/alpine/base/debian-build-kernel/Dockerfile b/alpine/base/debian-build-kernel/Dockerfile new file mode 100644 index 000000000..3ea659a18 --- /dev/null +++ b/alpine/base/debian-build-kernel/Dockerfile @@ -0,0 +1,24 @@ +FROM debian:jessie + +RUN apt-get update && apt-get -y upgrade && apt-get -y install \ + unzip \ + xz-utils \ + curl \ + bc \ + build-essential \ + cpio \ + gcc libc6 libc6-dev \ + kmod \ + squashfs-tools \ + genisoimage \ + xorriso \ + syslinux \ + isolinux \ + automake \ + pkg-config \ + git \ + ncurses-dev \ + p7zip-full \ + lzop \ + wget \ + vim diff --git a/alpine/base/debian-build-kernel/Makefile b/alpine/base/debian-build-kernel/Makefile new file mode 100644 index 000000000..2cfcae3a1 --- /dev/null +++ b/alpine/base/debian-build-kernel/Makefile @@ -0,0 +1,10 @@ +# no easy hashing scheme for Debian, will switch to Alpine soon so temporarily use sha256 +.PHONY: push + +BASE=debian:jessie +IMAGE=debian-build-kernel + +push: + docker pull $(BASE) + tar cf - Dockerfile | docker build --no-cache -t mobylinux/$(IMAGE):latest - + docker push mobylinux/$(IMAGE):latest diff --git a/alpine/kernel/Dockerfile b/alpine/kernel/Dockerfile index e3e42aea1..1f57e13c4 100644 --- a/alpine/kernel/Dockerfile +++ b/alpine/kernel/Dockerfile @@ -1,33 +1,10 @@ -FROM debian:jessie +FROM mobylinux/debian-build-kernel@sha256:412d36481df6123efc9a5a51656e13164f8178d11d682c63de8de82d43abd0d2 ARG KERNEL_VERSION=4.4.20 ARG DEBUG=0 ENV KERNEL_SOURCE=https://www.kernel.org/pub/linux/kernel/v4.x/linux-${KERNEL_VERSION}.tar.xz -RUN apt-get update && apt-get -y upgrade && apt-get -y install \ - unzip \ - xz-utils \ - curl \ - bc \ - build-essential \ - cpio \ - gcc libc6 libc6-dev \ - kmod \ - squashfs-tools \ - genisoimage \ - xorriso \ - syslinux \ - isolinux \ - automake \ - pkg-config \ - git \ - ncurses-dev \ - p7zip-full \ - lzop \ - wget \ - vim - RUN curl -sSL -o linux-${KERNEL_VERSION}.tar.xz ${KERNEL_SOURCE} RUN cat linux-${KERNEL_VERSION}.tar.xz | tar --absolute-names -xJ && mv /linux-${KERNEL_VERSION} /linux @@ -37,11 +14,13 @@ ENV AUFS_REPO https://github.com/sfjro/aufs4-standalone ENV AUFS_BRANCH aufs4.4 ENV AUFS_COMMIT 8be74e42b108f9cbbb0d59a87468505a48ff2757 -# Download AUFS and patch kernel +# Download AUFS RUN git clone -b "$AUFS_BRANCH" "$AUFS_REPO" /aufs && \ cd /aufs && \ - git checkout -q "$AUFS_COMMIT" && \ - cd /linux && \ + git checkout -q "$AUFS_COMMIT" + +# patch kernel with aufs +RUN cd /linux && \ cp -r /aufs/Documentation /linux && \ cp -r /aufs/fs /linux && \ cp -r /aufs/include/uapi/linux/aufs_type.h /linux/include/uapi/linux/ && \