Whamcloud - gitweb
LU-16356 hsm: add running ref to the coordinator
[fs/lustre-release.git] / contrib / Dockerfile-centos8
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
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 #  - configurable zfs repo, zfs version/tag
17 #  - move kernel to image
18 #
19
20 FROM docker.io/library/centos:8
21
22 # Centos8 is EOL
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-*
25
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
31
32 # to build lipe
33 RUN dnf install -y json-c-devel redhat-lsb libssh-devel libattr-devel
34
35 # to build zfs we need the kernel built
36 RUN /bin/bash -c \
37         "cd /tmp/linux-kernel; [[ ! -s arch/x86/boot/bzImage ]] && make oldconfig && make -j8 bzImage"
38
39 # to build ZFS
40 RUN dnf install -y libtirpc-devel libblkid-devel openssl-devel libuuid-devel
41
42 RUN dnf install -y git
43
44 #build and install latest e2fsprogs
45 RUN /bin/bash -c \
46         "git clone git://git.whamcloud.com/tools/e2fsprogs.git e2fsprogs && \
47         cd 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"
55
56
57 # build and install ZFS
58 RUN /bin/bash -c \
59         "rm -rf zfs && \
60         git clone https://github.com/zfsonlinux/zfs zfs && \
61         cd zfs && \
62         git checkout -b zfs-2.1.2 zfs-2.1.2 && \
63         sed -i 's/CDDL/GPL/' META && \
64         ./autogen.sh && \
65         ./configure \
66                 --with-linux=/tmp/linux-kernel \
67                 --with-linux-obj=/tmp/linux-kernel --prefix=/usr && \
68         make -j8 && \
69         make install && \
70         cd .. && rm -rf zfs"
71
72 RUN dnf remove -y git
73 RUN dnf clean all
74