Skip to content

Commit

Permalink
fix: script and dockerfile for centos
Browse files Browse the repository at this point in the history
- gn has to be compiled to satisfy centos glibc requirements and
  to mitigate problems with the version of envoy's wasm/v8
  dependency (ref: envoyproxy/envoy#15119)
- prependend PATH env var in centos' dockerfile by /usr/local/bin
  which was missing before and which is path where bazel is present
  (ref: envoyproxy/envoy/#12535)
- added installation of glibc-static and libstdc++-static

ref: envoyproxy/envoy#18365

Signed-off-by: Bart Smykla <bartek@smykla.com>
  • Loading branch information
bartsmykla committed Oct 5, 2021
1 parent 55a7bbe commit 93364f1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build_container/Dockerfile-centos
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ COPY --from=qemu /usr/bin/qemu-${QEMUARCH}-static /usr/bin/
COPY ./build_container_common.sh /
COPY ./build_container_centos.sh /

ENV PATH /opt/rh/rh-git218/root/usr/bin:/opt/rh/devtoolset-7/root/usr/bin:/opt/llvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV PATH /usr/local/bin:/opt/rh/rh-git218/root/usr/bin:/opt/rh/devtoolset-7/root/usr/bin:/opt/llvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN ./build_container_centos.sh
ENV LC_ALL en_US.UTF-8

Expand Down
21 changes: 19 additions & 2 deletions build_container/build_container_centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ if [[ "${ARCH}" == "x86_64" ]]; then
fi
yum update -y
yum install -y devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils java-1.8.0-openjdk-headless jq rsync \
rh-git218 wget unzip which make cmake3 patch ninja-build devtoolset-9-libatomic-devel openssl python27 \
libtool autoconf tcpdump graphviz doxygen sudo
rh-git218 wget unzip which make cmake3 patch ninja-build devtoolset-9-libatomic-devel openssl python27 \
libtool autoconf tcpdump graphviz doxygen sudo glibc-static libstdc++-static

# set locale
localedef -c -f UTF-8 -i en_US en_US.UTF-8
Expand Down Expand Up @@ -44,6 +44,23 @@ chgrp pcap /usr/sbin/tcpdump
chmod 750 /usr/sbin/tcpdump
setcap cap_net_raw,cap_net_admin=eip /usr/sbin/tcpdump

# compile proper version of gn, compatible with CentOS's GLIBC version and
# envoy wasm/v8 dependency
# can be removed when the dependency will be updated
git clone https://gn.googlesource.com/gn
pushd gn
# 45aa842fb41d79e149b46fac8ad71728856e15b9 is a hash of the version
# before https://gn.googlesource.com/gn/+/46b572ce4ceedfe57f4f84051bd7da624c98bf01
# as this commit expects envoy to rely on newer version of wasm/v8 with the fix
# from https://github.com/v8/v8/commit/eac21d572e92a82f5656379bc90f8ecf1ff884fc
# (versions 9.5.164 - 9.6.152)
git checkout 45aa842fb41d79e149b46fac8ad71728856e15b9
python build/gen.py
ninja -C out
mv -f out/gn /usr/local/bin/gn
chmod +x /usr/local/bin/gn
popd

# The build_container_common.sh will be skipped when building centOS
# image on Arm64 platform since some building issues are still unsolved.
# It will be fixed until those issues solved on Arm64 platform.
Expand Down

0 comments on commit 93364f1

Please sign in to comment.