1- FROM i386/centos:6
1+ FROM i386/centos:6 AS centos6_x86-base-be
22
33MAINTAINER Evolved Binary Ltd <tech@evolvedbinary.com>
44
55LABEL name="CentOS 6 (x86) RocksJava Build Environment" \
66 vendor="Evolved Binary Ltd"
77
8- COPY CentOS-buildlogs-devtoolset-8.repo /etc/yum.repos.d/CentOS-buildlogs-devtoolset-8.repo
8+ # make: Allow N jobs at once; infinite jobs with no arg
9+ ARG JOBS=1
910
11+ # 1. Build a base CentOS 6 Build Environment
12+ COPY CentOS-buildlogs-devtoolset-8.repo /etc/yum.repos.d/CentOS-buildlogs-devtoolset-8.repo
1013RUN curl --fail https://vault.centos.org/6.10/os/i386/Packages/udev-147-2.73.el6_8.2.i686.rpm --output /tmp/udev-147-2.73.el6_8.2.i686.rpm \
1114 && rpm -Uvh /tmp/udev-147-2.73.el6_8.2.i686.rpm --nodeps \
1215 && rm -f /tmp/udev-147-2.73.el6_8.2.i686.rpm \
@@ -20,15 +23,116 @@ RUN curl --fail https://vault.centos.org/6.10/os/i386/Packages/udev-147-2.73.el6
2023 && linux32 yum --setopt=tsflags=nodocs -y reinstall udev.i686 util-linux-ng.i686 \
2124 && linux32 yum --setopt=tsflags=nodocs -y update \
2225 && linux32 yum --setopt=tsflags=nodocs -y install epel-release \
23- && linux32 yum --setopt=tsflags=nodocs -y install git wget tar which \
24- && linux32 yum --setopt=tsflags=nodocs -y install make perl devtoolset-8 cmake3 \
25- && linux32 yum --setopt=tsflags=nodocs -y install jemalloc-devel zlib-devel bzip2-devel lz4-devel snappy-devel libzstd-devel \
26- && linux32 yum --setopt=tsflags=nodocs -y install openssl java-1.8.0-openjdk-devel \
27- && linux32 yum -y clean all \
26+ && linux32 yum --setopt=tsflags=nodocs -y upgrade \
27+ && linux32 yum --setopt=tsflags=nodocs -y install make devtoolset-8 \
28+ && linux32 yum --setopt=tsflags=nodocs -y install openssl curl wget tar which perl \
29+ && linux32 yum --setopt=tsflags=nodocs -y install gettext-devel openssl-devel zlib-devel jemalloc-devel \
30+ && linux32 yum -y clean all
31+
32+
33+ # 2. Build a newer nghttp (needed for libcurl)
34+ FROM centos6_x86-base-be AS centos6_x86-nghttp2-be
35+ RUN \
36+ wget --no-check-certificate https://github.com/nghttp2/nghttp2/releases/download/v1.58.0/nghttp2-1.58.0.tar.gz \
37+ && tar zxf nghttp2-1.58.0.tar.gz \
38+ && pushd nghttp2-1.58.0 \
39+ && linux32 scl enable devtoolset-8 './configure --prefix=/usr --with-openssl --with-zlib --with-jemalloc --enable-lib-only' \
40+ && linux32 scl enable devtoolset-8 'make -j $JOBS' \
41+ && linux32 scl enable devtoolset-8 'make install'
42+
43+
44+ # 3. Build a newer libcurl (needed for git)
45+ FROM centos6_x86-base-be AS centos6_x86-curl-be
46+ COPY --from=centos6_x86-nghttp2-be /usr/include/nghttp2 /usr/include/nghttp2
47+ COPY --from=centos6_x86-nghttp2-be /usr/lib/libnghttp2.a /usr/lib/libnghttp2.a
48+ COPY --from=centos6_x86-nghttp2-be /usr/lib/libnghttp2.so.14.25.1 /usr/lib/libnghttp2.so.14.25.1
49+ COPY --from=centos6_x86-nghttp2-be /usr/lib/libnghttp2.la /usr/lib/libnghttp2.la
50+ COPY --from=centos6_x86-nghttp2-be /usr/lib/pkgconfig/libnghttp2.pc /usr/lib/pkgconfig/libnghttp2.pc
51+ COPY --from=centos6_x86-nghttp2-be /usr/share/nghttp2 /usr/share/nghttp2
52+ RUN \
53+ pushd /usr/lib \
54+ && ln -s libnghttp2.so.14.25.1 libnghttp2.so \
55+ && ln -s libnghttp2.so.14.25.1 libnghttp2.so.14 \
56+ && linux32 ldconfig \
57+ && popd \
58+ && linux32 yum --setopt=tsflags=nodocs -y install libev-devel libssh2-devel \
59+ && wget --no-check-certificate https://curl.haxx.se/download/curl-8.5.0.tar.gz \
60+ && tar zxf curl-8.5.0.tar.gz \
61+ && pushd curl-8.5.0 \
62+ && linux32 scl enable devtoolset-8 './configure --prefix=/usr --enable-ipv6 --enable-unix-sockets --with-ssl --with-libssh2' \
63+ && linux32 scl enable devtoolset-8 'make -j $JOBS' \
64+ && linux32 scl enable devtoolset-8 'make install'
65+
66+
67+ # 4. Build a newer git (needed for CircleCI to use `git -B` in its `checkout` step)
68+ FROM centos6_x86-base-be AS centos6_x86-git-be
69+ COPY --from=centos6_x86-nghttp2-be /usr/include/nghttp2 /usr/include/nghttp2
70+ COPY --from=centos6_x86-nghttp2-be /usr/lib/libnghttp2.a /usr/lib/libnghttp2.a
71+ COPY --from=centos6_x86-nghttp2-be /usr/lib/libnghttp2.so.14.25.1 /usr/lib/libnghttp2.so.14.25.1
72+ COPY --from=centos6_x86-nghttp2-be /usr/lib/libnghttp2.la /usr/lib/libnghttp2.la
73+ COPY --from=centos6_x86-nghttp2-be /usr/lib/pkgconfig/libnghttp2.pc /usr/lib/pkgconfig/libnghttp2.pc
74+ COPY --from=centos6_x86-nghttp2-be /usr/share/nghttp2 /usr/share/nghttp2
75+ COPY --from=centos6_x86-curl-be /usr/bin/curl /usr/bin/curl
76+ COPY --from=centos6_x86-curl-be /usr/bin/curl-config /usr/bin/curl-config
77+ COPY --from=centos6_x86-curl-be /usr/include/curl /usr/include/curl
78+ COPY --from=centos6_x86-curl-be /usr/lib/libcurl.a /usr/lib/libcurl.a
79+ COPY --from=centos6_x86-curl-be /usr/lib/libcurl.la /usr/lib/libcurl.la
80+ COPY --from=centos6_x86-curl-be /usr/lib/libcurl.so.4.8.0 /usr/lib/libcurl.so.4.8.0
81+ COPY --from=centos6_x86-curl-be /usr/lib/pkgconfig/libcurl.pc /usr/lib/pkgconfig/libcurl.pc
82+ RUN \
83+ pushd /usr/lib \
84+ && ln -s libnghttp2.so.14.25.1 libnghttp2.so \
85+ && ln -s libnghttp2.so.14.25.1 libnghttp2.so.14 \
86+ && ln -s libcurl.so.4.8.0 libcurl.so \
87+ && mv libcurl.so.4.1.1 libcurl.so.4.1.1.OLD \
88+ && unlink libcurl.so.4 \
89+ && ln -s libcurl.so.4.8.0 libcurl.so.4 \
90+ && linux32 ldconfig \
91+ && popd \
92+ && linux32 yum --setopt=tsflags=nodocs -y install autoconf \
93+ && wget --no-check-certificate https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.43.0.tar.gz \
94+ && tar zxf git-2.43.0.tar.gz \
95+ && pushd git-2.43.0 \
96+ && linux32 scl enable devtoolset-8 'make configure' \
97+ && linux32 scl enable devtoolset-8 'NO_PERL=YesPlease NO_TCLTK=YesPlease ./configure --prefix=/usr' \
98+ && linux32 scl enable devtoolset-8 'make -j $JOBS all' \
99+ && linux32 scl enable devtoolset-8 'make install'
100+
101+
102+ # 5. Build a newer version of gflags (needed for RocksDB)
103+ FROM centos6_x86-base-be AS centos6_x86-gflags-be
104+ RUN \
105+ wget --no-check-certificate https://github.com/gflags/gflags/archive/v2.0.tar.gz -O gflags-2.0.tar.gz \
106+ && tar zxf gflags-2.0.tar.gz \
107+ && pushd gflags-2.0 \
108+ && linux32 scl enable devtoolset-8 './configure --prefix=/usr' \
109+ && linux32 scl enable devtoolset-8 'make -j $JOBS' \
110+ && linux32 scl enable devtoolset-8 'make install'
111+
112+
113+ # 6. Finally build the RocksDB Build Environment
114+ FROM centos6_x86-base-be AS centos6_x86-rocksdb-be
115+ COPY --from=centos6_x86-git-be /usr/bin/git /usr/bin/git
116+ COPY --from=centos6_x86-git-be /usr/libexec/git-core /usr/libexec/git-core
117+ COPY --from=centos6_x86-git-be /usr/share/git-core /usr/share/git-core
118+ COPY --from=centos6_x86-gflags-be /usr/lib/libgflags.a /usr/lib/libgflags.la /usr/lib/libgflags.so.2.1.0 /usr/lib/libgflags_nothreads.a /usr/lib/libgflags_nothreads.la /usr/lib/libgflags_nothreads.so.2.1.0 /usr/lib/
119+ COPY --from=centos6_x86-gflags-be /usr/include/gflags /usr/include/gflags
120+ COPY --from=centos6_x86-gflags-be /usr/include/google /usr/include/google
121+ COPY --from=centos6_x86-gflags-be /usr/lib/pkgconfig/libgflags* /usr/lib/pkgconfig/
122+ RUN \
123+ pushd /usr/lib \
124+ && ln -s libgflags.so.2.1.0 libgflags.so \
125+ && ln -s libgflags.so.2.1.0 libgflags.so.2 \
126+ && ln -s libgflags_nothreads.so.2.1.0 libgflags_nothreads.so \
127+ && ln -s libgflags_nothreads.so.2.1.0 libgflags_nothreads.so.2 \
128+ && ldconfig \
129+ && popd \
130+ && linux32 yum --setopt=tsflags=nodocs -y install cmake3 \
28131 && alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake 10 --slave /usr/local/bin/ctest ctest /usr/bin/ctest --slave /usr/local/bin/cpack cpack /usr/bin/cpack --slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake \
29132 && alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 --slave /usr/local/bin/ctest ctest /usr/bin/ctest3 --slave /usr/local/bin/cpack cpack /usr/bin/cpack3 --slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \
30- && curl --fail https://codeload.github.com/gflags/gflags/tar.gz/v2.0 --output /tmp/gflags-2.0.tar.gz \
31- && cd /tmp && tar xvfz gflags-2.0.tar.gz; cd gflags-2.0; linux32 scl enable devtoolset-8 ./configure; linux32 scl enable devtoolset-8 make; linux32 scl enable devtoolset-8 'make install' ; cd ..; rm -rf gflags-2.0*
133+ && linux32 yum --setopt=tsflags=nodocs -y install bzip2-devel lz4-devel snappy-devel libzstd-devel \
134+ && linux32 yum --setopt=tsflags=nodocs -y install java-1.8.0-openjdk-devel \
135+ && yum -y clean all
32136
33137ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0
34138ENV PATH=$JAVA_HOME:$PATH
0 commit comments