Skip to content

Commit ebfd896

Browse files
committed
fix: register gcc-11/g++-11 as the generic gcc/g++/cc/c++ alternatives
Installing gcc-11 and g++-11 only provides the versioned binaries; no generic gcc/g++/cc/c++ command existed, so node-gyp (and any other tool invoking the plain compiler names, as make-based builds do) failed with "g++: No such file or directory" even after make was installed.
1 parent 24c2c83 commit ebfd896

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎Dockerfile‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ ENV DEBIAN_FRONTEND=noninteractive
1313
RUN apt-get update \
1414
&& apt-get install -y --no-install-recommends \
1515
gcc-11 g++-11 make unzip \
16+
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 \
17+
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100 \
18+
&& update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-11 100 \
19+
&& update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-11 100 \
1620
&& rm -rf /var/lib/apt/lists/*
1721

1822
# Bun (JS runtime), installed system-wide. Explicit bash -c (the default RUN

0 commit comments

Comments
 (0)