Whamcloud - gitweb
LU-9680 lnet: collect data about routes by using Netlink
[fs/lustre-release.git] / contrib / Dockerfile-centos7
1 # first, build docker image with:
2 # $ podman build -t centos7-build -v <path-to-kernel>:/tmp/linux-kernel \
3 #       -f Docker-centos7 .
4 # this builds and image without ZFS
5 #
6 # then use it to build Lustre:
7 # $ podman run -it
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"
14 #
15 # TODO:
16 #  - add ZFS/SPL 0.7 to image
17 #  - configurable zfs repo, zfs version/tag
18 #  - move kernel to image
19 #
20
21 FROM centos:7
22
23 RUN yum install -y gcc autoconf libtool which make patch diffutils file \
24         binutils-devel install -y python38 python3-devel elfutils-devel \
25         libselinux-devel libaio-devel libyaml-devel bc libnl3-devel bison \
26         flex libmount-devel
27
28 # to build lipe
29 RUN yum install -y json-c-devel redhat-lsb-core libssh-devel libattr-devel
30
31 # to build ZFS
32 RUN yum install -y libtirpc-devel libblkid-devel openssl-devel libuuid-devel
33
34 RUN yum install -y git
35
36 #build and install latest e2fsprogs
37 RUN /bin/bash -c \
38         "git clone git://git.whamcloud.com/tools/e2fsprogs.git e2fsprogs && \
39         cd e2fsprogs && \
40         git checkout -b v1.46.2.wc5 v1.46.2.wc5 && \
41         ./configure --with-root-prefix=/usr --enable-elf-shlibs \
42                 --disable-uuidd --disable-fsck \
43                 --disable-e2initrd-helper \
44                 --disable-libblkid --disable-libuuid \
45                 --enable-quota --disable-fuse2fs && \
46         make -j8 && make install && cd .. && rm -rf e2fsprogs"
47
48 # to build zfs we need the kernel built
49 RUN /bin/bash -c \
50         "cd /tmp/linux-kernel; [[ ! -s arch/x86/boot/bzImage ]] && make oldconfig && make -j8 bzImage"
51
52 # build and install ZFS
53 RUN /bin/bash -c \
54         "git clone https://github.com/zfsonlinux/spl spl && \
55         cd spl && \
56         git checkout -b splbuild spl-0.7.13 && \
57         sed -i 's/CDDL/GPL/' META && \
58         ./autogen.sh && \
59         ./configure --with-linux=/tmp/linux-kernel \
60                 --with-linux-obj=/tmp/linux-kernel \
61                 --prefix=/usr && \
62         make -j8 && \
63         make install && \
64         rm -rf spl"
65
66 RUN /bin/bash -c \
67         "git clone https://github.com/zfsonlinux/zfs zfs && \
68         cd zfs && \
69         git checkout -b zfsbuild zfs-0.7.13 && \
70         sed -i 's/CDDL/GPL/' META && \
71         ./autogen.sh && \
72         ./configure --with-linux=/tmp/linux-kernel \
73                 --with-linux-obj=/tmp/linux-kernel \
74                 --prefix=/usr && \
75         make -j8 && \
76         make install && \
77         rm -rf zfs"
78
79 RUN yum remove -y git
80 RUN yum clean all
81