Skip to content

Commit 9cc4bef

Browse files
committed
Build and install a newer Git version to CentOS 6 images on x86 (i386) and x86_64
1 parent dad6c71 commit 9cc4bef

File tree

2 files changed

+231
-17
lines changed

2 files changed

+231
-17
lines changed

centos6_x64/Dockerfile

Lines changed: 118 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
FROM centos:6
1+
FROM centos:6 AS centos6_x64-base-be
22

33
MAINTAINER Evolved Binary Ltd <tech@evolvedbinary.com>
44

55
LABEL name="CentOS 6 (x64) RocksJava Build Environment" \
66
vendor="Evolved Binary Ltd"
77

8-
RUN sed -i s%mirrorlist=http%#mirrorlist=http%g /etc/yum.repos.d/CentOS-Base.repo \
8+
# make: Allow N jobs at once; infinite jobs with no arg
9+
ARG JOBS=1
10+
11+
12+
# 1. Build a base CentOS 6 Build Environment
13+
RUN \
14+
sed -i s%mirrorlist=http%#mirrorlist=http%g /etc/yum.repos.d/CentOS-Base.repo \
915
&& sed -i s%mirrorlist=http%#mirrorlist=http%g /etc/yum.repos.d/CentOS-fasttrack.repo \
1016
&& sed -i s%#baseurl=http://mirror.centos.org/centos/\$releasever/%baseurl=https://vault.centos.org/6.10/%g /etc/yum.repos.d/CentOS-Base.repo \
1117
&& sed -i s%#baseurl=http://mirror.centos.org/centos/\$releasever/%baseurl=https://vault.centos.org/6.10/%g /etc/yum.repos.d/CentOS-fasttrack.repo \
@@ -17,14 +23,118 @@ RUN sed -i s%mirrorlist=http%#mirrorlist=http%g /etc/yum.repos.d/CentOS-Base.rep
1723
&& sed -i s%#\\sbaseurl=http://mirror.centos.org/centos/6/%baseurl=https://vault.centos.org/6.10/%g /etc/yum.repos.d/CentOS-SCLo-scl.repo \
1824
&& sed -i s%#baseurl=http://mirror.centos.org/centos/6/%baseurl=https://vault.centos.org/6.10/%g /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo \
1925
&& yum --setopt=tsflags=nodocs -y upgrade \
20-
&& yum --setopt=tsflags=nodocs -y install devtoolset-7 cmake3 \
21-
&& yum --setopt=tsflags=nodocs -y install jemalloc-devel zlib-devel bzip2-devel lz4-devel snappy-devel libzstd-devel \
22-
&& yum --setopt=tsflags=nodocs -y install openssl java-1.8.0-openjdk-devel git wget \
23-
&& yum -y clean all \
26+
&& yum --setopt=tsflags=nodocs -y install devtoolset-7 \
27+
&& yum --setopt=tsflags=nodocs -y install openssl curl wget \
28+
&& yum --setopt=tsflags=nodocs -y install gettext-devel openssl-devel zlib-devel jemalloc-devel \
29+
&& yum -y clean all
30+
31+
32+
# 2. Build a newer nghttp (needed for libcurl)
33+
FROM centos6_x64-base-be AS centos6_x64-nghttp2-be
34+
RUN \
35+
wget --no-check-certificate https://github.com/nghttp2/nghttp2/releases/download/v1.58.0/nghttp2-1.58.0.tar.gz \
36+
&& tar zxf nghttp2-1.58.0.tar.gz \
37+
&& pushd nghttp2-1.58.0 \
38+
&& scl enable devtoolset-7 './configure --prefix=/usr --with-openssl --with-zlib --with-jemalloc --enable-lib-only' \
39+
&& scl enable devtoolset-7 'make -j $JOBS' \
40+
&& scl enable devtoolset-7 'make install'
41+
42+
43+
# 3. Build a newer libcurl (needed for git)
44+
FROM centos6_x64-base-be AS centos6_x64-curl-be
45+
COPY --from=centos6_x64-nghttp2-be /usr/include/nghttp2 /usr/include/nghttp2
46+
COPY --from=centos6_x64-nghttp2-be /usr/lib/libnghttp2.a /usr/lib/libnghttp2.a
47+
COPY --from=centos6_x64-nghttp2-be /usr/lib/libnghttp2.so.14.25.1 /usr/lib/libnghttp2.so.14.25.1
48+
COPY --from=centos6_x64-nghttp2-be /usr/lib/libnghttp2.la /usr/lib/libnghttp2.la
49+
COPY --from=centos6_x64-nghttp2-be /usr/lib/pkgconfig/libnghttp2.pc /usr/lib/pkgconfig/libnghttp2.pc
50+
COPY --from=centos6_x64-nghttp2-be /usr/share/nghttp2 /usr/share/nghttp2
51+
RUN \
52+
pushd /usr/lib \
53+
&& ln -s libnghttp2.so.14.25.1 libnghttp2.so \
54+
&& ln -s libnghttp2.so.14.25.1 libnghttp2.so.14 \
55+
&& ldconfig \
56+
&& popd \
57+
&& yum --setopt=tsflags=nodocs -y install libev-devel libssh2-devel \
58+
&& wget --no-check-certificate https://curl.haxx.se/download/curl-8.5.0.tar.gz \
59+
&& tar zxf curl-8.5.0.tar.gz \
60+
&& pushd curl-8.5.0 \
61+
&& scl enable devtoolset-7 './configure --prefix=/usr --enable-ipv6 --enable-unix-sockets --with-ssl --with-libssh2' \
62+
&& scl enable devtoolset-7 'make -j $JOBS' \
63+
&& scl enable devtoolset-7 'make install'
64+
65+
66+
# 4. Build a newer git (needed for CircleCI to use `git -B` in its `checkout` step)
67+
FROM centos6_x64-base-be AS centos6_x64-git-be
68+
COPY --from=centos6_x64-nghttp2-be /usr/include/nghttp2 /usr/include/nghttp2
69+
COPY --from=centos6_x64-nghttp2-be /usr/lib/libnghttp2.a /usr/lib/libnghttp2.a
70+
COPY --from=centos6_x64-nghttp2-be /usr/lib/libnghttp2.so.14.25.1 /usr/lib/libnghttp2.so.14.25.1
71+
COPY --from=centos6_x64-nghttp2-be /usr/lib/libnghttp2.la /usr/lib/libnghttp2.la
72+
COPY --from=centos6_x64-nghttp2-be /usr/lib/pkgconfig/libnghttp2.pc /usr/lib/pkgconfig/libnghttp2.pc
73+
COPY --from=centos6_x64-nghttp2-be /usr/share/nghttp2 /usr/share/nghttp2
74+
COPY --from=centos6_x64-curl-be /usr/bin/curl /usr/bin/curl
75+
COPY --from=centos6_x64-curl-be /usr/bin/curl-config /usr/bin/curl-config
76+
COPY --from=centos6_x64-curl-be /usr/include/curl /usr/include/curl
77+
COPY --from=centos6_x64-curl-be /usr/lib/libcurl.a /usr/lib/libcurl.a
78+
COPY --from=centos6_x64-curl-be /usr/lib/libcurl.la /usr/lib/libcurl.la
79+
COPY --from=centos6_x64-curl-be /usr/lib/libcurl.so.4.8.0 /usr/lib/libcurl.so.4.8.0
80+
COPY --from=centos6_x64-curl-be /usr/lib/pkgconfig/libcurl.pc /usr/lib/pkgconfig/libcurl.pc
81+
RUN \
82+
pushd /usr/lib \
83+
&& ln -s libnghttp2.so.14.25.1 libnghttp2.so \
84+
&& ln -s libnghttp2.so.14.25.1 libnghttp2.so.14 \
85+
&& ln -s libcurl.so.4.8.0 libcurl.so \
86+
&& ln -s libcurl.so.4.8.0 libcurl.so.4 \
87+
&& ldconfig \
88+
&& popd \
89+
&& pushd /usr/lib64 \
90+
&& mv libcurl.so.4.1.1 libcurl.so.4.1.1.OLD \
91+
&& unlink libcurl.so.4 \
92+
&& ln -s /usr/lib/libcurl.so.4 libcurl.so.4 \
93+
&& popd \
94+
&& yum --setopt=tsflags=nodocs -y install autoconf \
95+
&& wget --no-check-certificate https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.43.0.tar.gz \
96+
&& tar zxf git-2.43.0.tar.gz \
97+
&& pushd git-2.43.0 \
98+
&& scl enable devtoolset-7 'make configure' \
99+
&& scl enable devtoolset-7 'NO_PERL=YesPlease NO_TCLTK=YesPlease ./configure --prefix=/usr' \
100+
&& scl enable devtoolset-7 'make -j $JOBS all' \
101+
&& scl enable devtoolset-7 'make install'
102+
103+
104+
# 5. Build a newer version of gflags (needed for RocksDB)
105+
FROM centos6_x64-base-be AS centos6_x64-gflags-be
106+
RUN \
107+
wget --no-check-certificate https://github.com/gflags/gflags/archive/v2.0.tar.gz -O gflags-2.0.tar.gz \
108+
&& tar zxf gflags-2.0.tar.gz \
109+
&& pushd gflags-2.0 \
110+
&& scl enable devtoolset-7 './configure --prefix=/usr' \
111+
&& scl enable devtoolset-7 'make -j $JOBS' \
112+
&& scl enable devtoolset-7 'make install'
113+
114+
115+
# 6. Finally build the RocksDB Build Environment
116+
FROM centos6_x64-base-be AS centos6_x64-rocksdb-be
117+
COPY --from=centos6_x64-git-be /usr/bin/git /usr/bin/git
118+
COPY --from=centos6_x64-git-be /usr/libexec/git-core /usr/libexec/git-core
119+
COPY --from=centos6_x64-git-be /usr/share/git-core /usr/share/git-core
120+
COPY --from=centos6_x64-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/
121+
COPY --from=centos6_x64-gflags-be /usr/include/gflags /usr/include/gflags
122+
COPY --from=centos6_x64-gflags-be /usr/include/google /usr/include/google
123+
COPY --from=centos6_x64-gflags-be /usr/lib/pkgconfig/libgflags* /usr/lib/pkgconfig/
124+
RUN \
125+
pushd /usr/lib \
126+
&& ln -s libgflags.so.2.1.0 libgflags.so \
127+
&& ln -s libgflags.so.2.1.0 libgflags.so.2 \
128+
&& ln -s libgflags_nothreads.so.2.1.0 libgflags_nothreads.so \
129+
&& ln -s libgflags_nothreads.so.2.1.0 libgflags_nothreads.so.2 \
130+
&& ldconfig \
131+
&& popd \
132+
&& yum --setopt=tsflags=nodocs -y install cmake3 \
24133
&& 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 \
25134
&& 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 \
26-
&& wget https://github.com/gflags/gflags/archive/v2.0.tar.gz -O gflags-2.0.tar.gz \
27-
&& tar xvfz gflags-2.0.tar.gz; cd gflags-2.0; scl enable devtoolset-7 ./configure; scl enable devtoolset-7 make; scl enable devtoolset-7 'make install'; cd ..; rm -r gflags-2.0*
135+
&& yum --setopt=tsflags=nodocs -y install bzip2-devel lz4-devel snappy-devel libzstd-devel \
136+
&& yum --setopt=tsflags=nodocs -y install java-1.8.0-openjdk-devel \
137+
&& yum -y clean all
28138

29139
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0
30140
ENV PATH=$JAVA_HOME:$PATH

centos6_x86/Dockerfile

Lines changed: 113 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
FROM i386/centos:6
1+
FROM i386/centos:6 AS centos6_x86-base-be
22

33
MAINTAINER Evolved Binary Ltd <tech@evolvedbinary.com>
44

55
LABEL 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
1013
RUN 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

33137
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0
34138
ENV PATH=$JAVA_HOME:$PATH

0 commit comments

Comments
 (0)