-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
213 lines (189 loc) · 10.1 KB
/
Dockerfile
File metadata and controls
213 lines (189 loc) · 10.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
FROM s390x/clefos:7 AS centos7_s390x-base-be
LABEL org.opencontainers.image.authors="Evolved Binary Ltd <tech@evolvedbinary.com>"
LABEL name="CentOS 7 (s390x) RocksJava Build Environment" \
vendor="Evolved Binary Ltd"
# make: Allow N jobs at once; infinite jobs with no arg
ARG JOBS=1
# version of nghttp2 to compile
ARG NGHTTP2_VERSION=1.66.0
# version of libpsl to compile
ARG LIBPSL_VERSION=0.21.5
# version of curl to compile
ARG CURL_VERSION=8.14.1
# version of Git to compile
ARG GIT_VERSION=2.48.1
# version of Apache Maven to install
ARG MAVEN_VERSION=3.9.12
# version of cmake to compile
ARG CMAKE_VERSION_SHORT=3.31
ARG CMAKE_VERSION=3.31.8
# version of gflags to compile
ARG GFLAGS_VERSION=2.2.2
# 1. Build a base CentOS 7 Build Environment
COPY ClefOS-Base.repo /etc/yum.repos.d/ClefOS-Base.repo
COPY ClefOS-Extras.repo /etc/yum.repos.d/ClefOS-Extras.repo
COPY ClefOS-CentOSPlus.repo /etc/yum.repos.d/ClefOS-CentOSPlus.repo
RUN \
yum --setopt=tsflags=nodocs -y update \
&& yum -y install centos-release-scl-rh \
&& yum --setopt=tsflags=nodocs -y upgrade \
&& yum --setopt=tsflags=nodocs -y install devtoolset-11-gcc devtoolset-11-gcc-c++ devtoolset-11-binutils devtoolset-11-runtime \
&& yum --setopt=tsflags=nodocs -y install make perl python3 which bzip2 wget \
&& yum --setopt=tsflags=nodocs -y install gettext-devel openssl openssl-devel zlib-devel expat-devel libssh2-devel jemalloc-devel \
&& yum -y clean all
# 2. Build a newer nghttp (needed for libcurl)
FROM centos7_s390x-base-be AS centos7_s390x-nghttp2-be
RUN \
wget -qO- https://github.com/nghttp2/nghttp2/releases/download/v$NGHTTP2_VERSION/nghttp2-$NGHTTP2_VERSION.tar.gz | tar -zxvf- -C /tmp \
&& pushd /tmp/nghttp2-$NGHTTP2_VERSION \
&& scl enable devtoolset-11 './configure --prefix=/usr --with-openssl --with-zlib --with-jemalloc --enable-lib-only' \
&& scl enable devtoolset-11 'make -j $JOBS' \
&& scl enable devtoolset-11 'make install' \
&& popd \
&& rm -rf /tmp/nghttp2-$NGHTTP2_VERSION
# 3. build a newer libpsl (needed for libcurl)
FROM centos7_s390x-base-be AS centos7_s390x-libpsl-be
RUN \
wget -qO- https://github.com/rockdaboot/libpsl/releases/download/$LIBPSL_VERSION/libpsl-$LIBPSL_VERSION.tar.gz | tar -zxvf- -C /tmp \
&& pushd /tmp/libpsl-$LIBPSL_VERSION \
&& scl enable devtoolset-11 './configure --prefix=/usr' \
&& scl enable devtoolset-11 'make -j $JOBS' \
&& scl enable devtoolset-11 'make install' \
&& popd \
&& rm -rf /tmp/libpsl-$LIBPSL_VERSION
# 4. Build a newer libcurl (needed for git)
FROM centos7_s390x-base-be AS centos7_s390x-curl-be
COPY --from=centos7_s390x-nghttp2-be /usr/include/nghttp2 /usr/include/nghttp2
COPY --from=centos7_s390x-nghttp2-be /usr/lib/libnghttp2.a /usr/lib/libnghttp2.a
COPY --from=centos7_s390x-nghttp2-be /usr/lib/libnghttp2.so.14.28.5 /usr/lib/libnghttp2.so.14.28.5
COPY --from=centos7_s390x-nghttp2-be /usr/lib/libnghttp2.la /usr/lib/libnghttp2.la
COPY --from=centos7_s390x-nghttp2-be /usr/lib/pkgconfig/libnghttp2.pc /usr/lib/pkgconfig/libnghttp2.pc
#COPY --from=centos7_s390x-nghttp2-be /usr/share/nghttp2 /usr/share/nghttp2
COPY --from=centos7_s390x-libpsl-be /usr/include/libpsl.h /usr/include/libpsl.h
COPY --from=centos7_s390x-libpsl-be /usr/lib/libpsl.a /usr/lib/libpsl.a
COPY --from=centos7_s390x-libpsl-be /usr/lib/libpsl.so.5.3.5 /usr/lib/libpsl.so.5.3.5
COPY --from=centos7_s390x-libpsl-be /usr/lib/libpsl.la /usr/lib/libpsl.a
RUN \
pushd /usr/lib \
&& ln -s libnghttp2.so.14.28.5 libnghttp2.so \
&& ln -s libnghttp2.so.14.28.5 libnghttp2.so.14 \
&& ln -s libpsl.so.5.3.5 libpsl.so \
&& ln -s libpsl.so.5.3.5 libpsl.so.5 \
&& ldconfig \
&& popd \
&& yum --setopt=tsflags=nodocs -y install libev-devel libpsl \
&& wget -qO- https://curl.haxx.se/download/curl-$CURL_VERSION.tar.gz | tar -zxvf- -C /tmp \
&& pushd /tmp/curl-$CURL_VERSION \
&& scl enable devtoolset-11 './configure --prefix=/usr --enable-ipv6 --enable-unix-sockets --with-ssl --with-libssh2' \
&& scl enable devtoolset-11 'make -j $JOBS' \
&& scl enable devtoolset-11 'make install' \
&& popd \
&& rm -rf /tmp/curl-$CURL_VERSION
# 5. Build a newer git (needed for GitHub Actions to use `git --progress` in its `checkout` step)
FROM centos7_s390x-base-be AS centos7_s390x-git-be
COPY --from=centos7_s390x-nghttp2-be /usr/include/nghttp2 /usr/include/nghttp2
COPY --from=centos7_s390x-nghttp2-be /usr/lib/libnghttp2.a /usr/lib/libnghttp2.a
COPY --from=centos7_s390x-nghttp2-be /usr/lib/libnghttp2.so.14.28.5 /usr/lib/libnghttp2.so.14.28.5
COPY --from=centos7_s390x-nghttp2-be /usr/lib/libnghttp2.la /usr/lib/libnghttp2.la
COPY --from=centos7_s390x-nghttp2-be /usr/lib/pkgconfig/libnghttp2.pc /usr/lib/pkgconfig/libnghttp2.pc
#COPY --from=centos7_s390x-nghttp2-be /usr/share/nghttp2 /usr/share/nghttp2
COPY --from=centos7_s390x-libpsl-be /usr/include/libpsl.h /usr/include/libpsl.h
COPY --from=centos7_s390x-libpsl-be /usr/lib/libpsl.a /usr/lib/libpsl.a
COPY --from=centos7_s390x-libpsl-be /usr/lib/libpsl.so.5.3.5 /usr/lib/libpsl.so.5.3.5
COPY --from=centos7_s390x-libpsl-be /usr/lib/libpsl.la /usr/lib/libpsl.a
COPY --from=centos7_s390x-curl-be /usr/bin/curl /usr/bin/curl
COPY --from=centos7_s390x-curl-be /usr/bin/curl-config /usr/bin/curl-config
COPY --from=centos7_s390x-curl-be /usr/include/curl /usr/include/curl
COPY --from=centos7_s390x-curl-be /usr/lib/libcurl.a /usr/lib/libcurl.a
COPY --from=centos7_s390x-curl-be /usr/lib/libcurl.la /usr/lib/libcurl.la
COPY --from=centos7_s390x-curl-be /usr/lib/libcurl.so.4.8.0 /usr/lib/libcurl.so.4.8.0
COPY --from=centos7_s390x-curl-be /usr/lib/libcurl.so.4.8.0 /usr/lib64/libcurl.so.4.8.0
#COPY --from=centos7_s390x-curl-be /usr/lib64/libcurl.so.4.8.0 /usr/lib64/libcurl.so.4.8.0
COPY --from=centos7_s390x-curl-be /usr/lib/pkgconfig/libcurl.pc /usr/lib/pkgconfig/libcurl.pc
RUN \
pushd /usr/lib \
&& ln -s libnghttp2.so.14.28.5 libnghttp2.so \
&& ln -s libnghttp2.so.14.28.5 libnghttp2.so.14 \
&& ln -s libpsl.so.5.3.5 libpsl.so \
&& ln -s libpsl.so.5.3.5 libpsl.so.5 \
&& ln -s libcurl.so.4.8.0 libcurl.so \
&& ln -s libcurl.so.4.8.0 libcurl.so.4 \
&& ldconfig \
&& popd \
&& pushd /usr/lib64 \
&& unlink libcurl.so.4 \
&& rm libcurl.so.4.3.0 \
&& ln -s libcurl.so.4.8.0 libcurl.so.4 \
&& ldconfig \
&& popd \
&& yum --setopt=tsflags=nodocs -y install autoconf \
&& wget -qO- https://mirrors.edge.kernel.org/pub/software/scm/git/git-$GIT_VERSION.tar.gz | tar -zxvf- -C /tmp \
&& pushd /tmp/git-$GIT_VERSION \
&& scl enable devtoolset-11 'make configure' \
&& scl enable devtoolset-11 'NO_PERL=YesPlease NO_TCLTK=YesPlease NO_GETTEXT=YesPlease ./configure --prefix=/usr' \
&& scl enable devtoolset-11 'make -j $JOBS all' \
&& scl enable devtoolset-11 'make install' \
&& popd \
&& rm -rf /tmp/git-$GIT_VERSION
# 6. Finally build the RocksDB Build Environment
FROM centos7_s390x-base-be AS centos7_s390x-rocksdb-be
COPY --from=centos7_s390x-git-be /usr/bin/git /usr/bin/git
COPY --from=centos7_s390x-git-be /usr/libexec/git-core /usr/libexec/git-core
COPY --from=centos7_s390x-git-be /usr/share/git-core /usr/share/git-core
COPY --from=centos7_s390x-nghttp2-be /usr/include/nghttp2 /usr/include/nghttp2
COPY --from=centos7_s390x-nghttp2-be /usr/lib/libnghttp2.a /usr/lib/libnghttp2.a
COPY --from=centos7_s390x-nghttp2-be /usr/lib/libnghttp2.so.14.28.5 /usr/lib/libnghttp2.so.14.28.5
COPY --from=centos7_s390x-nghttp2-be /usr/lib/libnghttp2.la /usr/lib/libnghttp2.la
COPY --from=centos7_s390x-nghttp2-be /usr/lib/pkgconfig/libnghttp2.pc /usr/lib/pkgconfig/libnghttp2.pc
#COPY --from=centos7_s390x-nghttp2-be /usr/share/nghttp2 /usr/share/nghttp2
COPY --from=centos7_s390x-libpsl-be /usr/include/libpsl.h /usr/include/libpsl.h
COPY --from=centos7_s390x-libpsl-be /usr/lib/libpsl.a /usr/lib/libpsl.a
COPY --from=centos7_s390x-libpsl-be /usr/lib/libpsl.so.5.3.5 /usr/lib/libpsl.so.5.3.5
COPY --from=centos7_s390x-libpsl-be /usr/lib/libpsl.la /usr/lib/libpsl.a
COPY --from=centos7_s390x-curl-be /usr/bin/curl /usr/bin/curl
COPY --from=centos7_s390x-curl-be /usr/bin/curl-config /usr/bin/curl-config
COPY --from=centos7_s390x-curl-be /usr/include/curl /usr/include/curl
COPY --from=centos7_s390x-curl-be /usr/lib/libcurl.a /usr/lib/libcurl.a
COPY --from=centos7_s390x-curl-be /usr/lib/libcurl.la /usr/lib/libcurl.la
COPY --from=centos7_s390x-curl-be /usr/lib/libcurl.so.4.8.0 /usr/lib/libcurl.so.4.8.0
COPY --from=centos7_s390x-curl-be /usr/lib/libcurl.so.4.8.0 /usr/lib64/libcurl.so.4.8.0
#COPY --from=centos7_s390x-curl-be /usr/lib64/libcurl.so.4.8.0 /usr/lib64/libcurl.so.4.8.0
COPY --from=centos7_s390x-curl-be /usr/lib/pkgconfig/libcurl.pc /usr/lib/pkgconfig/libcurl.pc
RUN \
pushd /usr/lib \
&& ln -s libnghttp2.so.14.28.5 libnghttp2.so \
&& ln -s libnghttp2.so.14.28.5 libnghttp2.so.14 \
&& ln -s libpsl.so.5.3.5 libpsl.so \
&& ln -s libpsl.so.5.3.5 libpsl.so.5 \
&& ln -s libcurl.so.4.8.0 libcurl.so \
&& ln -s libcurl.so.4.8.0 libcurl.so.4 \
&& ldconfig \
&& popd \
&& pushd /usr/lib64 \
&& unlink libcurl.so.4 \
&& rm libcurl.so.4.3.0 \
&& ln -s libcurl.so.4.8.0 libcurl.so.4 \
&& ldconfig \
&& popd \
&& yum --setopt=tsflags=nodocs -y install bzip2-devel lz4-devel snappy-devel libzstd-devel \
&& yum --setopt=tsflags=nodocs -y install java-1.8.0-openjdk-devel \
&& yum -y clean all \
&& wget -qO- https://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar -zxvf- -C /opt \
&& wget -qO- https://cmake.org/files/v$CMAKE_VERSION_SHORT/cmake-$CMAKE_VERSION.tar.gz | tar -zxvf- -C /tmp \
&& pushd /tmp/cmake-$CMAKE_VERSION \
&& scl enable devtoolset-11 './bootstrap --system-curl' \
&& scl enable devtoolset-11 'make -j $JOBS' \
&& scl enable devtoolset-11 'make install' \
&& popd \
&& rm -rf /tmp/cmake-$CMAKE_VERSION \
&& wget -qO- https://github.com/gflags/gflags/archive/refs/tags/v$GFLAGS_VERSION.tar.gz | tar -zxvf- -C /tmp \
&& mkdir /tmp/gflags-$GFLAGS_VERSION/build \
&& pushd /tmp/gflags-$GFLAGS_VERSION/build \
&& scl enable devtoolset-11 'CMAKE_INSTALL_PREFIX=/usr cmake ..' \
&& scl enable devtoolset-11 'make -j $JOBS' \
&& scl enable devtoolset-11 'make install' \
&& popd \
&& rm -rf /tmp/gflags-$GFLAGS_VERSION
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0
ENV M2_HOME=/opt/apache-maven-$MAVEN_VERSION
ENV PATH=$JAVA_HOME:$M2_HOME/bin:$PATH