Files
linuxkit/kernel/Dockerfile.zfs
Rolf Neugebauer 03e0d67051 kernel: Update alpine to latest
Signed-off-by: Rolf Neugebauer <rn@rneugeba.io>
2019-04-17 07:43:18 +01:00

66 lines
1.4 KiB
Docker

ARG IMAGE
FROM ${IMAGE} AS ksrc
FROM linuxkit/alpine:86cd4f51b49fb9a078b50201d892a3c7973d48ec AS build
RUN apk add \
attr-dev \
autoconf \
automake \
build-base \
file \
git \
libtirpc-dev \
libtool \
mpc1-dev \
mpfr-dev \
util-linux-dev \
zlib-dev
COPY --from=ksrc /kernel-dev.tar /
RUN tar xf kernel-dev.tar
# Also extract the kernel modules
COPY --from=ksrc /kernel.tar /
RUN tar xf kernel.tar
# Note: ZFS and SPL commits must match. It's unclear how much the user
# space tools must match the kernel module version.
# package on Alpine is 0.6.5.9. We pick the version that compiles with
# latest kernel we support.
ENV VERSION=0.7.12
ENV SPL_REPO=https://github.com/zfsonlinux/spl.git
ENV SPL_COMMIT=spl-${VERSION}
RUN git clone ${SPL_REPO} && \
cd spl && \
git checkout ${SPL_COMMIT}
ENV ZFS_REPO=https://github.com/zfsonlinux/zfs.git
ENV ZFS_COMMIT=zfs-${VERSION}
RUN git clone ${ZFS_REPO} && \
cd zfs && \
git checkout ${ZFS_COMMIT}
WORKDIR /spl
RUN ./autogen.sh && \
./configure && \
cd module && \
make && \
make install
WORKDIR /zfs
RUN ./autogen.sh && \
./configure --with-spl=/spl && \
cd module && \
make -j "$(getconf _NPROCESSORS_ONLN)" && \
make install
# Run depmod against the new module directory.
RUN cd /lib/modules && \
depmod -ae *
FROM scratch
ENTRYPOINT []
CMD []
WORKDIR /
COPY --from=build /lib/modules/ /lib/modules/