Skip to content

Commit

Permalink
hotfix for build compile image (#148)
Browse files Browse the repository at this point in the history
* hotfix for build compile image

* add -fPIC for make cpprest

* hotfix for maven and brpc
  • Loading branch information
lloydzhou authored Jan 20, 2023
1 parent abf8bd9 commit 8121e02
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions ci/images/compile/centos-7-Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ RUN wget https://github.com/gflags/gflags/archive/v2.2.1.tar.gz -O gflags-2.2.1.
# install leveldb
RUN wget https://github.com/google/leveldb/archive/refs/tags/v1.20.zip \
&& unzip v1.20.zip && mv leveldb-1.20 leveldb \
&& cd leveldb && git checkout v1.20 && CFLAGS="-fPIC" CXXFLAGS="-fPIC" make -j4 \
&& cd leveldb && CFLAGS="-fPIC" CXXFLAGS="-fPIC" make -j4 \
&& cp -r ./include/leveldb/ /usr/local/include/ \
&& cp ./out-shared/libleveldb.so.1.20 /usr/local/lib/ \
&& cp ./out-static/libleveldb.a /usr/local/lib/ \
Expand Down Expand Up @@ -115,15 +115,15 @@ RUN python3 -m pip install pytest

#install maven
RUN cd opt \
&& wget --no-check-certificate https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz \
&& tar xf apache-maven-3.8.6-bin.tar.gz \
&& wget --no-check-certificate https://dlcdn.apache.org/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.tar.gz \
&& tar xf apache-maven-3.8.7-bin.tar.gz \
&& rm apache-maven-*.tar.gz

ARG CMAKE_OPT="-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 -DBUILD_TESTS=0 -DBUILD_SAMPLES=0 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++"

# brpc
RUN wget https://github.com/apache/incubator-brpc/archive/refs/heads/release-1.2.zip \
&& unzip release-1.2.zip && mv incubator-brpc-release-1.2 brpc && cd /brpc && mkdir build && cd build \
&& unzip release-1.2.zip && mv brpc-release-1.2 brpc && cd /brpc && mkdir build && cd build \
&& cmake $CMAKE_OPT -DBUILD_UNIT_TESTS=0 .. && make -j && make install \
&& rm -rf /brpc*

Expand All @@ -133,7 +133,7 @@ RUN wget https://github.com/microsoft/cpprestsdk/archive/refs/tags/v2.10.18.zip
&& wget https://github.com/zaphoyd/websocketpp/archive/56123c87598f8b1dd471be83ca841ceae07f95ba.zip \
&& unzip 56123c87598f8b1dd471be83ca841ceae07f95ba.zip && rm -rf websocketpp && mv websocketpp-56123c87598f8b1dd471be83ca841ceae07f95ba websocketpp \
&& cd .. && mkdir build && cd build \
&& cmake $CMAKE_OPT -DCMAKE_CXX_FLAGS=-Wno-error=unused-parameter -DBoost_USE_STATIC_LIBS=1 .. && make -j && make install \
&& cmake $CMAKE_OPT -DCMAKE_CXX_FLAGS=-fPIC -Wno-error=unused-parameter -DBoost_USE_STATIC_LIBS=1 .. && make -j && make install \
&& rm -rf /cpprestsdk*

# googletest
Expand Down Expand Up @@ -177,5 +177,5 @@ RUN sed -i '3 s/-lgomp/-l:libgomp.a/' /usr/local/lib64/libgomp.spec
ENV JAVA_HOME=/usr/local/lib64:/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server \
LD_LIBRARY_PATH=/usr/local/lib64:/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server:$LD_LIBRARY_PATH \
PYTHONPATH=/usr/local/lib64:$PYTHONPATH \
PATH=/opt/apache-maven-3.8.6/bin:$PATH
PATH=/opt/apache-maven-3.8.7/bin:$PATH

12 changes: 6 additions & 6 deletions ci/images/compile/centos-8-Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ RUN wget https://github.com/gflags/gflags/archive/v2.2.1.tar.gz -O gflags-2.2.1.
# install leveldb
RUN wget https://github.com/google/leveldb/archive/refs/tags/v1.20.zip \
&& unzip v1.20.zip && mv leveldb-1.20 leveldb \
&& cd leveldb && git checkout v1.20 && CFLAGS="-fPIC" CXXFLAGS="-fPIC" make -j4 \
&& cd leveldb && CFLAGS="-fPIC" CXXFLAGS="-fPIC" make -j4 \
&& cp -r ./include/leveldb/ /usr/local/include/ \
&& cp ./out-shared/libleveldb.so.1.20 /usr/local/lib/ \
&& cp ./out-static/libleveldb.a /usr/local/lib/ \
Expand Down Expand Up @@ -108,15 +108,15 @@ RUN python3 -m pip install pytest

# install maven
RUN cd opt \
&& wget --no-check-certificate https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz \
&& tar xf apache-maven-3.8.6-bin.tar.gz \
&& wget --no-check-certificate https://dlcdn.apache.org/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.tar.gz \
&& tar xf apache-maven-3.8.7-bin.tar.gz \
&& rm apache-maven-*.tar.gz

ARG CMAKE_OPT="-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 -DBUILD_TESTS=0 -DBUILD_SAMPLES=0 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++"

# brpc
RUN wget https://github.com/apache/incubator-brpc/archive/refs/heads/release-1.2.zip \
&& unzip release-1.2.zip && mv incubator-brpc-release-1.2 brpc && cd /brpc && mkdir build && cd build \
&& unzip release-1.2.zip && mv brpc-release-1.2 brpc && cd /brpc && mkdir build && cd build \
&& cmake $CMAKE_OPT -DBUILD_UNIT_TESTS=0 .. && make -j && make install \
&& rm -rf /brpc*

Expand All @@ -126,7 +126,7 @@ RUN wget https://github.com/microsoft/cpprestsdk/archive/refs/tags/v2.10.18.zip
&& wget https://github.com/zaphoyd/websocketpp/archive/56123c87598f8b1dd471be83ca841ceae07f95ba.zip \
&& unzip 56123c87598f8b1dd471be83ca841ceae07f95ba.zip && rm -rf websocketpp && mv websocketpp-56123c87598f8b1dd471be83ca841ceae07f95ba websocketpp \
&& cd .. && mkdir build && cd build \
&& cmake $CMAKE_OPT -DCMAKE_CXX_FLAGS=-Wno-error=unused-parameter -DBoost_USE_STATIC_LIBS=1 .. && make -j && make install \
&& cmake $CMAKE_OPT -DCMAKE_CXX_FLAGS=-fPIC -Wno-error=unused-parameter -DBoost_USE_STATIC_LIBS=1 .. && make -j && make install \
&& rm -rf /cpprestsdk*

# googletest
Expand Down Expand Up @@ -179,4 +179,4 @@ RUN sed -i '3 s/-lgomp/-l:libgomp.a/' /usr/local/lib64/libgomp.spec
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0/jre/ \
LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:/usr/lib/jvm/java-1.8.0/jre/lib/amd64/server:$LD_LIBRARY_PATH \
PYTHONPATH=/usr/local/lib64:$PYTHONPATH \
PATH=/opt/apache-maven-3.8.6/bin:$PATH
PATH=/opt/apache-maven-3.8.7/bin:$PATH
10 changes: 5 additions & 5 deletions ci/images/compile/ubuntu-18.04-Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ RUN wget https://github.com/gflags/gflags/archive/v2.2.1.tar.gz -O gflags-2.2.1.
# install leveldb
RUN wget https://github.com/google/leveldb/archive/refs/tags/v1.20.zip \
&& unzip v1.20.zip && mv leveldb-1.20 leveldb \
&& cd leveldb && git checkout v1.20 && CFLAGS="-fPIC" CXXFLAGS="-fPIC" make -j4 \
&& cd leveldb && CFLAGS="-fPIC" CXXFLAGS="-fPIC" make -j4 \
&& cp -r ./include/leveldb/ /usr/local/include/ \
&& cp ./out-shared/libleveldb.so.1.20 /usr/local/lib/ \
&& cp ./out-static/libleveldb.a /usr/local/lib/ \
Expand Down Expand Up @@ -120,15 +120,15 @@ RUN python3 -m pip install pytest

#install maven
RUN cd opt \
&& wget --no-check-certificate https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz \
&& tar xf apache-maven-3.8.6-bin.tar.gz \
&& wget --no-check-certificate https://dlcdn.apache.org/maven/maven-3/3.8.7/binaries/apache-maven-3.8.7-bin.tar.gz \
&& tar xf apache-maven-3.8.7-bin.tar.gz \
&& rm apache-maven-*.tar.gz

ARG CMAKE_OPT="-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 -DBUILD_TESTS=0 -DBUILD_SAMPLES=0 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++"

# brpc
RUN wget https://github.com/apache/incubator-brpc/archive/refs/heads/release-1.2.zip \
&& unzip release-1.2.zip && mv incubator-brpc-release-1.2 brpc && cd /brpc && mkdir build && cd build \
&& unzip release-1.2.zip && mv brpc-release-1.2 brpc && cd /brpc && mkdir build && cd build \
&& cmake $CMAKE_OPT -DBUILD_UNIT_TESTS=0 .. && make -j && make install \
&& rm -rf /brpc*

Expand All @@ -138,7 +138,7 @@ RUN wget https://github.com/microsoft/cpprestsdk/archive/refs/tags/v2.10.18.zip
&& wget https://github.com/zaphoyd/websocketpp/archive/56123c87598f8b1dd471be83ca841ceae07f95ba.zip \
&& unzip 56123c87598f8b1dd471be83ca841ceae07f95ba.zip && rm -rf websocketpp && mv websocketpp-56123c87598f8b1dd471be83ca841ceae07f95ba websocketpp \
&& cd .. && mkdir build && cd build \
&& cmake $CMAKE_OPT -DCMAKE_CXX_FLAGS=-Wno-error=unused-parameter -DBoost_USE_STATIC_LIBS=1 .. && make -j && make install \
&& cmake $CMAKE_OPT -DCMAKE_CXX_FLAGS=-fPIC -Wno-error=unused-parameter -DBoost_USE_STATIC_LIBS=1 .. && make -j && make install \
&& rm -rf /cpprestsdk*

# googletest
Expand Down

0 comments on commit 8121e02

Please sign in to comment.