forked from linuxkit/linuxkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.zfs
51 lines (44 loc) · 1.08 KB
/
Dockerfile.zfs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
ARG IMAGE
FROM ${IMAGE} AS ksrc
FROM linuxkit/alpine:3fdc49366257e53276c6f363956a4353f95d9a81 AS build
RUN apk add \
attr-dev \
autoconf \
automake \
build-base \
file \
git \
libtirpc-dev \
libtool \
mpc1-dev \
mpfr-dev \
openssl-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
# SPL is part of the ZFS repo since 0.8.0 (https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.8.0)
ENV VERSION=0.8.1
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 /zfs
RUN ./autogen.sh && \
./configure && \
./scripts/make_gitrev.sh && \
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/