1- FROM arm64v8/centos:7
1+ FROM arm64v8/centos:7 AS centos7_arm64v8-base-be
22
33LABEL org.opencontainers.image.authors="Evolved Binary Ltd <tech@evolvedbinary.com>"
44
55LABEL name="CentOS 7 (arm64v8) RocksJava Build Environment" \
66 vendor="Evolved Binary Ltd"
77
8- COPY bellsoft.repo /etc/yum.repos.d/bellsoft.repo
8+ # make: Allow N jobs at once; infinite jobs with no arg
9+ ARG JOBS=1
10+
11+ # version of nghttp2 to compile
12+ ARG NGHTTP2_VERSION=1.66.0
13+
14+ # version of libpsl to compile
15+ ARG LIBPSL_VERSION=0.21.5
16+
17+ # version of curl to compile
18+ ARG CURL_VERSION=8.14.1
19+
20+ # version of Git to compile
21+ ARG GIT_VERSION=2.48.1
22+
23+ # version of cmake to compile
24+ ARG CMAKE_VERSION_SHORT=3.31
25+ ARG CMAKE_VERSION=3.31.8
926
10- RUN sed -i s%mirrorlist=http%#mirrorlist=http%g /etc/yum.repos.d/CentOS-Base.repo \
27+ # version of zstd to compile
28+ ARG ZSTD_VERSION=1.5.7
29+
30+ # version of gflags to compile
31+ ARG GFLAGS_VERSION=2.2.2
32+
33+
34+ # 1. Build a base CentOS 7 Build Environment
35+ RUN \
36+ sed -i s%mirrorlist=http%#mirrorlist=http%g /etc/yum.repos.d/CentOS-Base.repo \
1137 && sed -i s%mirrorlist=http%#mirrorlist=http%g /etc/yum.repos.d/CentOS-fasttrack.repo \
1238 && sed -i s%#baseurl=http://mirror.centos.org/altarch/\$ releasever/%baseurl=https://vault.centos.org/altarch/7.9.2009/%g /etc/yum.repos.d/CentOS-Base.repo \
1339 && sed -i s%#baseurl=http://mirror.centos.org/altarch/\$ releasever/%baseurl=https://vault.centos.org/altarch/7.9.2009/%g /etc/yum.repos.d/CentOS-fasttrack.repo \
@@ -19,13 +45,187 @@ RUN sed -i s%mirrorlist=http%#mirrorlist=http%g /etc/yum.repos.d/CentOS-Base.rep
1945 && sed -i s%#\\ sbaseurl=http://mirror.centos.org/centos/7/%baseurl=https://vault.centos.org/altarch/7.9.2009/%g /etc/yum.repos.d/CentOS-SCLo-scl.repo \
2046 && sed -i s%#baseurl=http://mirror.centos.org/centos/7/%baseurl=https://vault.centos.org/altarch/7.9.2009/%g /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo \
2147 && yum --setopt=tsflags=nodocs -y upgrade \
22- && yum --setopt=tsflags=nodocs -y install devtoolset-7 cmake3 \
23- && yum --setopt=tsflags=nodocs -y install make perl which \
24- && yum --setopt=tsflags=nodocs -y install jemalloc-devel zlib-devel bzip2-devel lz4-devel snappy-devel libzstd-devel gflags-devel \
25- && yum --setopt=tsflags=nodocs -y install openssl bellsoft-java8 wget git \
48+ && yum --setopt=tsflags=nodocs -y install devtoolset-7 \
49+ && yum --setopt=tsflags=nodocs -y install make perl which bzip2 wget \
50+ && yum --setopt=tsflags=nodocs -y install gettext-devel openssl openssl-devel zlib-devel expat-devel libssh2-devel jemalloc-devel \
51+ && yum -y clean all
52+
53+
54+ # 2. Build a newer nghttp (needed for libcurl)
55+ FROM centos7_arm64v8-base-be AS centos7_arm64v8-nghttp2-be
56+ RUN \
57+ wget https://github.com/nghttp2/nghttp2/releases/download/v$NGHTTP2_VERSION/nghttp2-$NGHTTP2_VERSION.tar.gz \
58+ && tar zxf nghttp2-$NGHTTP2_VERSION.tar.gz \
59+ && pushd nghttp2-$NGHTTP2_VERSION \
60+ && scl enable devtoolset-7 './configure --prefix=/usr --with-openssl --with-zlib --with-jemalloc --enable-lib-only' \
61+ && scl enable devtoolset-7 'make -j $JOBS' \
62+ && scl enable devtoolset-7 'make install' \
63+ && popd \
64+ && rm -rf nghttp2-$NGHTTP2_VERSION nghttp2-$NGHTTP2_VERSION.tar.gz
65+
66+
67+ # 3. build a newer libpsl (needed for libcurl)
68+ FROM centos7_arm64v8-base-be AS centos7_arm64v8-libpsl-be
69+ RUN \
70+ wget https://github.com/rockdaboot/libpsl/releases/download/$LIBPSL_VERSION/libpsl-$LIBPSL_VERSION.tar.gz \
71+ && tar zxf libpsl-$LIBPSL_VERSION.tar.gz \
72+ && pushd libpsl-$LIBPSL_VERSION \
73+ && scl enable devtoolset-7 './configure --prefix=/usr' \
74+ && scl enable devtoolset-7 'make -j $JOBS' \
75+ && scl enable devtoolset-7 'make install' \
76+ && popd \
77+ && rm -rf libpsl-$LIBPSL_VERSION libpsl-$LIBPSL_VERSION.tar.gz
78+
79+
80+ # 4. Build a newer libcurl (needed for git)
81+ FROM centos7_arm64v8-base-be AS centos7_arm64v8-curl-be
82+ COPY --from=centos7_arm64v8-nghttp2-be /usr/include/nghttp2 /usr/include/nghttp2
83+ COPY --from=centos7_arm64v8-nghttp2-be /usr/lib/libnghttp2.a /usr/lib/libnghttp2.a
84+ COPY --from=centos7_arm64v8-nghttp2-be /usr/lib/libnghttp2.so.14.28.5 /usr/lib/libnghttp2.so.14.28.5
85+ COPY --from=centos7_arm64v8-nghttp2-be /usr/lib/libnghttp2.la /usr/lib/libnghttp2.la
86+ COPY --from=centos7_arm64v8-nghttp2-be /usr/lib/pkgconfig/libnghttp2.pc /usr/lib/pkgconfig/libnghttp2.pc
87+ # COPY --from=centos7_arm64v8-nghttp2-be /usr/share/nghttp2 /usr/share/nghttp2
88+ COPY --from=centos7_arm64v8-libpsl-be /usr/include/libpsl.h /usr/include/libpsl.h
89+ COPY --from=centos7_arm64v8-libpsl-be /usr/lib/libpsl.a /usr/lib/libpsl.a
90+ COPY --from=centos7_arm64v8-libpsl-be /usr/lib/libpsl.so.5.3.5 /usr/lib/libpsl.so.5.3.5
91+ COPY --from=centos7_arm64v8-libpsl-be /usr/lib/libpsl.la /usr/lib/libpsl.a
92+ RUN \
93+ pushd /usr/lib \
94+ && ln -s libnghttp2.so.14.28.5 libnghttp2.so \
95+ && ln -s libnghttp2.so.14.28.5 libnghttp2.so.14 \
96+ && ln -s libpsl.so.5.3.5 libpsl.so \
97+ && ln -s libpsl.so.5.3.5 libpsl.so.5 \
98+ && ldconfig \
99+ && popd \
100+ && yum --setopt=tsflags=nodocs -y install libev-devel libpsl \
101+ && wget https://curl.haxx.se/download/curl-$CURL_VERSION.tar.gz \
102+ && tar zxf curl-$CURL_VERSION.tar.gz \
103+ && pushd curl-$CURL_VERSION \
104+ && scl enable devtoolset-7 './configure --prefix=/usr --enable-ipv6 --enable-unix-sockets --with-ssl --with-libssh2' \
105+ && scl enable devtoolset-7 'make -j $JOBS' \
106+ && scl enable devtoolset-7 'make install' \
107+ && popd \
108+ && rm -rf curl-$CURL_VERSION curl-$CURL_VERSION.tar.gz
109+
110+
111+ # 5. Build a newer git (needed for GitHub Actions to use `git --progress` in its `checkout` step)
112+ FROM centos7_arm64v8-base-be AS centos7_arm64v8-git-be
113+ COPY --from=centos7_arm64v8-nghttp2-be /usr/include/nghttp2 /usr/include/nghttp2
114+ COPY --from=centos7_arm64v8-nghttp2-be /usr/lib/libnghttp2.a /usr/lib/libnghttp2.a
115+ COPY --from=centos7_arm64v8-nghttp2-be /usr/lib/libnghttp2.so.14.28.5 /usr/lib/libnghttp2.so.14.28.5
116+ COPY --from=centos7_arm64v8-nghttp2-be /usr/lib/libnghttp2.la /usr/lib/libnghttp2.la
117+ COPY --from=centos7_arm64v8-nghttp2-be /usr/lib/pkgconfig/libnghttp2.pc /usr/lib/pkgconfig/libnghttp2.pc
118+ # COPY --from=centos7_arm64v8-nghttp2-be /usr/share/nghttp2 /usr/share/nghttp2
119+ COPY --from=centos7_arm64v8-libpsl-be /usr/include/libpsl.h /usr/include/libpsl.h
120+ COPY --from=centos7_arm64v8-libpsl-be /usr/lib/libpsl.a /usr/lib/libpsl.a
121+ COPY --from=centos7_arm64v8-libpsl-be /usr/lib/libpsl.so.5.3.5 /usr/lib/libpsl.so.5.3.5
122+ COPY --from=centos7_arm64v8-libpsl-be /usr/lib/libpsl.la /usr/lib/libpsl.a
123+ COPY --from=centos7_arm64v8-curl-be /usr/bin/curl /usr/bin/curl
124+ COPY --from=centos7_arm64v8-curl-be /usr/bin/curl-config /usr/bin/curl-config
125+ COPY --from=centos7_arm64v8-curl-be /usr/include/curl /usr/include/curl
126+ COPY --from=centos7_arm64v8-curl-be /usr/lib/libcurl.a /usr/lib/libcurl.a
127+ COPY --from=centos7_arm64v8-curl-be /usr/lib/libcurl.la /usr/lib/libcurl.la
128+ COPY --from=centos7_arm64v8-curl-be /usr/lib/libcurl.so.4.8.0 /usr/lib/libcurl.so.4.8.0
129+ COPY --from=centos7_arm64v8-curl-be /usr/lib/libcurl.so.4.8.0 /usr/lib64/libcurl.so.4.8.0
130+ # COPY --from=centos7_arm64v8-curl-be /usr/lib64/libcurl.so.4.8.0 /usr/lib64/libcurl.so.4.8.0
131+ COPY --from=centos7_arm64v8-curl-be /usr/lib/pkgconfig/libcurl.pc /usr/lib/pkgconfig/libcurl.pc
132+ RUN \
133+ pushd /usr/lib \
134+ && ln -s libnghttp2.so.14.28.5 libnghttp2.so \
135+ && ln -s libnghttp2.so.14.28.5 libnghttp2.so.14 \
136+ && ln -s libpsl.so.5.3.5 libpsl.so \
137+ && ln -s libpsl.so.5.3.5 libpsl.so.5 \
138+ && ln -s libcurl.so.4.8.0 libcurl.so \
139+ && ln -s libcurl.so.4.8.0 libcurl.so.4 \
140+ && ldconfig \
141+ && popd \
142+ && pushd /usr/lib64 \
143+ && unlink libcurl.so.4 \
144+ && rm libcurl.so.4.3.0 \
145+ && ln -s libcurl.so.4.8.0 libcurl.so.4 \
146+ && ldconfig \
147+ && popd \
148+ && yum --setopt=tsflags=nodocs -y install autoconf \
149+ && wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-$GIT_VERSION.tar.gz \
150+ && tar zxf git-$GIT_VERSION.tar.gz \
151+ && pushd git-$GIT_VERSION \
152+ && scl enable devtoolset-7 'make configure' \
153+ && scl enable devtoolset-7 'NO_PERL=YesPlease NO_TCLTK=YesPlease NO_GETTEXT=YesPlease ./configure --prefix=/usr' \
154+ && scl enable devtoolset-7 'make -j $JOBS all' \
155+ && scl enable devtoolset-7 'make install' \
156+ && popd \
157+ && rm -rf git-$GIT_VERSION git-$GIT_VERSION.tar.gz
158+
159+
160+ # 6. Finally build the RocksDB Build Environment
161+ FROM centos7_arm64v8-base-be AS centos7_arm64v8-rocksdb-be
162+ COPY bellsoft.repo /etc/yum.repos.d/bellsoft.repo
163+ COPY --from=centos7_arm64v8-git-be /usr/bin/git /usr/bin/git
164+ COPY --from=centos7_arm64v8-git-be /usr/libexec/git-core /usr/libexec/git-core
165+ COPY --from=centos7_arm64v8-git-be /usr/share/git-core /usr/share/git-core
166+ COPY --from=centos7_arm64v8-nghttp2-be /usr/include/nghttp2 /usr/include/nghttp2
167+ COPY --from=centos7_arm64v8-nghttp2-be /usr/lib/libnghttp2.a /usr/lib/libnghttp2.a
168+ COPY --from=centos7_arm64v8-nghttp2-be /usr/lib/libnghttp2.so.14.28.5 /usr/lib/libnghttp2.so.14.28.5
169+ COPY --from=centos7_arm64v8-nghttp2-be /usr/lib/libnghttp2.la /usr/lib/libnghttp2.la
170+ COPY --from=centos7_arm64v8-nghttp2-be /usr/lib/pkgconfig/libnghttp2.pc /usr/lib/pkgconfig/libnghttp2.pc
171+ # COPY --from=centos7_arm64v8-nghttp2-be /usr/share/nghttp2 /usr/share/nghttp2
172+ COPY --from=centos7_arm64v8-libpsl-be /usr/include/libpsl.h /usr/include/libpsl.h
173+ COPY --from=centos7_arm64v8-libpsl-be /usr/lib/libpsl.a /usr/lib/libpsl.a
174+ COPY --from=centos7_arm64v8-libpsl-be /usr/lib/libpsl.so.5.3.5 /usr/lib/libpsl.so.5.3.5
175+ COPY --from=centos7_arm64v8-libpsl-be /usr/lib/libpsl.la /usr/lib/libpsl.a
176+ COPY --from=centos7_arm64v8-curl-be /usr/bin/curl /usr/bin/curl
177+ COPY --from=centos7_arm64v8-curl-be /usr/bin/curl-config /usr/bin/curl-config
178+ COPY --from=centos7_arm64v8-curl-be /usr/include/curl /usr/include/curl
179+ COPY --from=centos7_arm64v8-curl-be /usr/lib/libcurl.a /usr/lib/libcurl.a
180+ COPY --from=centos7_arm64v8-curl-be /usr/lib/libcurl.la /usr/lib/libcurl.la
181+ COPY --from=centos7_arm64v8-curl-be /usr/lib/libcurl.so.4.8.0 /usr/lib/libcurl.so.4.8.0
182+ COPY --from=centos7_arm64v8-curl-be /usr/lib/libcurl.so.4.8.0 /usr/lib64/libcurl.so.4.8.0
183+ # COPY --from=centos7_arm64v8-curl-be /usr/lib64/libcurl.so.4.8.0 /usr/lib64/libcurl.so.4.8.0
184+ COPY --from=centos7_arm64v8-curl-be /usr/lib/pkgconfig/libcurl.pc /usr/lib/pkgconfig/libcurl.pc
185+ RUN \
186+ pushd /usr/lib \
187+ && ln -s libnghttp2.so.14.28.5 libnghttp2.so \
188+ && ln -s libnghttp2.so.14.28.5 libnghttp2.so.14 \
189+ && ln -s libpsl.so.5.3.5 libpsl.so \
190+ && ln -s libpsl.so.5.3.5 libpsl.so.5 \
191+ && ln -s libcurl.so.4.8.0 libcurl.so \
192+ && ln -s libcurl.so.4.8.0 libcurl.so.4 \
193+ && ldconfig \
194+ && popd \
195+ && pushd /usr/lib64 \
196+ && unlink libcurl.so.4 \
197+ && rm libcurl.so.4.3.0 \
198+ && ln -s libcurl.so.4.8.0 libcurl.so.4 \
199+ && ldconfig \
200+ && popd \
201+ && yum --setopt=tsflags=nodocs -y install bzip2-devel lz4-devel snappy-devel \
202+ && yum --setopt=tsflags=nodocs -y install bellsoft-java8 \
26203 && yum -y clean all \
27- && 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 \
28- && 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
204+ && wget https://cmake.org/files/v$CMAKE_VERSION_SHORT/cmake-$CMAKE_VERSION.tar.gz \
205+ && tar zxvf cmake-$CMAKE_VERSION.tar.gz \
206+ && pushd cmake-$CMAKE_VERSION \
207+ && scl enable devtoolset-7 './bootstrap --system-curl' \
208+ && scl enable devtoolset-7 'make -j $JOBS' \
209+ && scl enable devtoolset-7 'make install' \
210+ && popd \
211+ && rm -rf cmake-$CMAKE_VERSION cmake-$CMAKE_VERSION.tar.gz \
212+ && wget https://github.com/facebook/zstd/releases/download/v$ZSTD_VERSION/zstd-$ZSTD_VERSION.tar.gz \
213+ && tar zxvf zstd-$ZSTD_VERSION.tar.gz \
214+ && pushd zstd-$ZSTD_VERSION \
215+ && scl enable devtoolset-7 'make -j $JOBS' \
216+ && scl enable devtoolset-7 'make prefix=/usr install' \
217+ && popd \
218+ && rm -rf zstd-$ZSTD_VERSION zstd-$ZSTD_VERSION.tar.gz \
219+ && wget -O gflags-$GFLAGS_VERSION.tar.gz https://github.com/gflags/gflags/archive/refs/tags/v$GFLAGS_VERSION.tar.gz \
220+ && tar zxvf gflags-$GFLAGS_VERSION.tar.gz \
221+ && mkdir gflags-$GFLAGS_VERSION/build \
222+ && pushd gflags-$GFLAGS_VERSION/build \
223+ && scl enable devtoolset-7 'CMAKE_INSTALL_PREFIX=/usr cmake ..' \
224+ && scl enable devtoolset-7 'make -j $JOBS' \
225+ && scl enable devtoolset-7 'make install' \
226+ && popd \
227+ && rm -rf gflags-$GFLAGS_VERSION gflags-$GFLAGS_VERSION.tar.gz
228+
29229
30230ENV JAVA_HOME=/usr/lib/jvm/bellsoft-java8.aarch64
31231ENV PATH=$JAVA_HOME/bin:$PATH
0 commit comments