1 # first, build docker image with:
2 # $ podman build -t centos8-build -v <path-to-kernel>:/tmp/linux-kernel \
3 # -f Dockerfile-centos8
4 # this builds a image with ZFS cloned from original repo
6 # then use it to build Lustre:
8 # --mount type=bind,source=<path-to-kernel>,target=/tmp/kernel \
9 # --mount type=bind,source=<path-to-lustre>,target=/tmp/lustre \
10 # centos8-build /bin/bash -c "cd /tmp/lustre; sh autogen.sh; \
11 # ./configure --with-linux=<path-to-kernel> \
12 # --with-linux-obj=<path-to-kernel> --disable-gss \
13 # --disable-shared --disable-crypto; make"
16 # - configurable zfs repo, zfs version/tag
17 # - move kernel to image
20 FROM docker.io/library/centos:8
23 RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
24 RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
26 RUN dnf install -y gcc autoconf libtool which make patch diffutils file \
27 binutils-devel python38 python3-devel elfutils-devel e2fsprogs-devel \
28 libselinux-devel libaio-devel dnf-plugins-core bc bison flex
29 RUN yum config-manager --set-enabled powertools
30 RUN yum install -y libyaml-devel libnl3-devel libmount-devel
33 RUN dnf install -y json-c-devel redhat-lsb libssh-devel libattr-devel
35 # to build zfs we need the kernel built
37 "cd /tmp/linux-kernel; [[ ! -s arch/x86/boot/bzImage ]] && make oldconfig && make -j8 bzImage"
40 RUN dnf install -y libtirpc-devel libblkid-devel openssl-devel libuuid-devel
42 RUN dnf install -y git
44 #build and install latest e2fsprogs
46 "git clone git://git.whamcloud.com/tools/e2fsprogs.git e2fsprogs && \
48 git checkout -b v1.46.2.wc5 v1.46.2.wc5 && \
49 ./configure --with-root-prefix=/usr --enable-elf-shlibs \
50 --disable-uuidd --disable-fsck \
51 --disable-e2initrd-helper \
52 --disable-libblkid --disable-libuuid \
53 --enable-quota --disable-fuse2fs && \
54 make -j8 && make install && cd .. && rm -rf e2fsprogs"
57 # build and install ZFS
60 git clone https://github.com/zfsonlinux/zfs zfs && \
62 git checkout -b zfs-2.1.2 zfs-2.1.2 && \
63 sed -i 's/CDDL/GPL/' META && \
66 --with-linux=/tmp/linux-kernel \
67 --with-linux-obj=/tmp/linux-kernel --prefix=/usr && \