Skip to content

Commit

Permalink
Try node 20 on amazon linux docker
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoMDomingues committed Sep 24, 2024
1 parent 29633cb commit 42b1add
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions docker/aws-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ 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
RUN cd /tmp && wget https://www.openssl.org/source/openssl-1.1.1s.tar.gz && tar xvfz openssl-1.1.1s.tar.gz && rm openssl-1.1.1s.tar.gz
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 \
Expand Down Expand Up @@ -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"

0 comments on commit 42b1add

Please sign in to comment.