Skip to content

Commit 03ecd86

Browse files
Use GCC 11 instead of GCC 13 for GLIBCXX compatibility
GCC 13 requires GLIBCXX_3.4.31/32 which Ubuntu 22.04 doesn't have. GCC 11 supports C++20 (required by V8) and has compatible symbols. Updated: - Dockerfile.Node24 - Dockerfile.Fibers - Dockerfile.Packages Co-Authored-By: Claude (global.anthropic.claude-opus-4-5-20251101-v1:0) <noreply@anthropic.com>
1 parent 408c5e9 commit 03ecd86

3 files changed

Lines changed: 78 additions & 29 deletions

File tree

Dockerfile.Fibers

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,32 @@ FROM ubuntu:22.04 AS base
55
ENV DEBIAN_FRONTEND=noninteractive
66

77
# Install necessary dependencies
8-
# Install GCC 13 from Ubuntu Toolchain PPA for full C++20 support
9-
RUN apt-get update
10-
RUN apt-get install -y software-properties-common
11-
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
12-
RUN apt-get update
13-
RUN apt-get install -y build-essential python3 python3-distutils gcc-13 g++-13 make curl git pkg-config libssl-dev libffi-dev libgmp-dev libtool autoconf automake cmake wget xz-utils unzip vim
14-
15-
# Set GCC 13 as the default compiler
16-
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100
17-
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100
8+
# Use GCC 11 (default in Ubuntu 22.04) for C++20 support with compatible GLIBCXX symbols
9+
RUN apt-get update && apt-get install -y \
10+
build-essential \
11+
python3 \
12+
python3-distutils \
13+
g++-11 \
14+
make \
15+
curl \
16+
git \
17+
pkg-config \
18+
libssl-dev \
19+
libffi-dev \
20+
libgmp-dev \
21+
libtool \
22+
autoconf \
23+
automake \
24+
cmake \
25+
wget \
26+
xz-utils \
27+
unzip \
28+
vim \
29+
&& rm -rf /var/lib/apt/lists/*
30+
31+
# Set GCC 11 as the default compiler
32+
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
33+
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100
1834

1935
# Copy local Node.js source into the image
2036
WORKDIR /usr/src/node

Dockerfile.Node24

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,33 @@ ENV DEBIAN_FRONTEND=noninteractive
66

77
# Install necessary dependencies
88
# Ubuntu 22.04 has Python 3.10 which meets Node.js v24 requirement (3.9+)
9-
# Install GCC 13 from Ubuntu Toolchain PPA for full C++20 support
10-
RUN apt-get update
11-
RUN apt-get install -y software-properties-common
12-
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
13-
RUN apt-get update && apt-get install -y build-essential python3 python3-distutils gcc-13 g++-13 make curl git pkg-config libssl-dev libffi-dev libgmp-dev libtool autoconf automake cmake wget xz-utils unzip vim
14-
RUN rm -rf /var/lib/apt/lists/*
9+
# Use GCC 11 (default in Ubuntu 22.04) for C++20 support with compatible GLIBCXX symbols
10+
# GCC 13 requires GLIBCXX_3.4.31/32 which older systems don't have
11+
RUN apt-get update && apt-get install -y \
12+
build-essential \
13+
python3 \
14+
python3-distutils \
15+
g++-11 \
16+
make \
17+
curl \
18+
git \
19+
pkg-config \
20+
libssl-dev \
21+
libffi-dev \
22+
libgmp-dev \
23+
libtool \
24+
autoconf \
25+
automake \
26+
cmake \
27+
wget \
28+
xz-utils \
29+
unzip \
30+
vim \
31+
&& rm -rf /var/lib/apt/lists/*
1532

16-
# Set GCC 13 as the default compiler
17-
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100
18-
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100
33+
# Set GCC 11 as the default compiler
34+
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
35+
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100
1936

2037
# Copy local Node.js source into the image
2138
WORKDIR /usr/src/node

Dockerfile.Packages

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,32 @@ FROM ubuntu:22.04 AS base
55
ENV DEBIAN_FRONTEND=noninteractive
66

77
# Install necessary dependencies
8-
# Install GCC 13 from Ubuntu Toolchain PPA for full C++20 support
9-
RUN apt-get update
10-
RUN apt-get install -y software-properties-common
11-
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
12-
RUN apt-get update
13-
RUN apt-get install -y build-essential python3 python3-distutils gcc-13 g++-13 make curl git pkg-config libssl-dev libffi-dev libgmp-dev libtool autoconf automake cmake wget xz-utils unzip vim
14-
15-
# Set GCC 13 as the default compiler
16-
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100
17-
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 100
8+
# Use GCC 11 (default in Ubuntu 22.04) for C++20 support with compatible GLIBCXX symbols
9+
RUN apt-get update && apt-get install -y \
10+
build-essential \
11+
python3 \
12+
python3-distutils \
13+
g++-11 \
14+
make \
15+
curl \
16+
git \
17+
pkg-config \
18+
libssl-dev \
19+
libffi-dev \
20+
libgmp-dev \
21+
libtool \
22+
autoconf \
23+
automake \
24+
cmake \
25+
wget \
26+
xz-utils \
27+
unzip \
28+
vim \
29+
&& rm -rf /var/lib/apt/lists/*
30+
31+
# Set GCC 11 as the default compiler
32+
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
33+
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100
1834

1935
# Copy local Node.js source into the image
2036
WORKDIR /usr/src/node

0 commit comments

Comments
 (0)