diff --git a/docker/aws-linux/Dockerfile b/docker/aws-linux/Dockerfile index 6392d2fc..53fdb7ec 100644 --- a/docker/aws-linux/Dockerfile +++ b/docker/aws-linux/Dockerfile @@ -2,7 +2,7 @@ FROM amazonlinux:2 RUN yum -y update && yum -y upgrade RUN yum -y groupinstall "Development Tools" -RUN yum -y install git wget which +RUN yum -y install git wget which patchelf RUN amazon-linux-extras enable python3.8 && yum -y install python3.8 # Build openssl-1.1.1s @@ -10,7 +10,7 @@ RUN cd /tmp && wget https://www.openssl.org/source/openssl-1.1.1s.tar.gz && tar RUN cd /tmp/openssl-1.1.1s && ./config && make -j5 && make install_sw RUN cd /tmp && wget https://cmake.org/files/v3.18/cmake-3.18.0.tar.gz && tar -xvzf cmake-3.18.0.tar.gz \ - && cd cmake-3.18.0 && ./bootstrap && make -j5 && make install + && cd cmake-3.18.0 && ./bootstrap && make -j$(getconf _NPROCESSORS_ONLN) && make install RUN cd /tmp \ && wget -O clang+llvm-12.0.1-x86_64-linux.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz \ @@ -48,8 +48,28 @@ RUN cd /tmp \ && make -j5 \ && make install -# Install Node 16 for running Github Actions as most recent node verions -# that would be added (mounterd) by Github Actions one that is -# is not compatible with GLIBC available on Amazon Linux 2 (Centos 7) -RUN curl -sL https://rpm.nodesource.com/setup_16.x | bash - -RUN yum -y install nodejs +# Restore old GCC's ld to build glibc +RUN ln -sf /usr/bin/ld /usr/local/bin/ld + +RUN wget -qO- http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz | tar zxv -C /tmp/ \ + && cd /tmp/glibc-2.18 && mkdir -p build && cd build \ + && CC=gcc CXX= LD_LIBRARY_PATH= ../configure --prefix=/opt/glibc-2.18 \ + && make -j$(getconf _NPROCESSORS_ONLN) \ + && LD_LIBRARY_PATH= make install \ + && cd /tmp && rm -rf /tmp/glibc-2.18 + +# Restore new CLANG's ld +RUN ln -sf /usr/local/bin/lld /usr/local/bin/ld + + +# Install Node 20 for running Github Actions with glibc-2.28 +# to avoid mouting a node version that does not support current GLIBC installed +RUN wget -qO- https://nodejs.org/dist/v20.17.0/node-v20.17.0.tar.gz | tar zxv -C /tmp/ \ + && cd /tmp/node-v20.17.0 \ + && CC=clang CXX=clang++ CXXFLAGS="-stdlib=libc++" LDFLAGS="-L/usr/local/lib/ -Wl,-rpath,/usr/local/lib/ -lc++ -lc++abi" LD_LIBRARY_PATH=/opt/glibc-2.28/lib PATH=/opt/glibc-2.28/bin:$PATH ./configure --prefix=/opt/node-20.17 \ + && CC=clang CXX=clang++ CXXFLAGS="-stdlib=libc++" LDFLAGS="-L/usr/local/lib/ -Wl,-rpath,/usr/local/lib/ -lc++ -lc++abi" LD_LIBRARY_PATH=/opt/glibc-2.28/lib PATH=/opt/glibc-2.28/bin:$PATH make -j$(nproc) \ + && CC=clang CXX=clang++ CXXFLAGS="-stdlib=libc++" LDFLAGS="-L/usr/local/lib/ -Wl,-rpath,/usr/local/lib/ -lc++ -lc++abi" LD_LIBRARY_PATH=/opt/glibc-2.28/lib PATH=/opt/glibc-2.28/bin:$PATH make -j$(nproc) install \ + && cd /tmp && rm -rf /tmp/node-v20.17.0 + +ENV PATH="$PATH:/opt/node-20.17/bin" +