Skip to content

Commit 1f975dd

Browse files
committed
Add almalinux-devtoolset11 image
As alternative to centos7-devtoolset7 which: - No longer builds (because mirrorlist.centos.org is offline) - Doesn't support Node.js >= 18 - Doesn't support C++ 20. Ref: prebuild/prebuildify-cross#13 Ref: Level/classic-level#103 (comment)
1 parent a1aca07 commit 1f975dd

File tree

6 files changed

+45
-11
lines changed

6 files changed

+45
-11
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,3 @@ updates:
44
directory: /
55
schedule:
66
interval: monthly
7-
# Other base images are unversioned
8-
- package-ecosystem: docker
9-
directory: /centos7-devtoolset7
10-
schedule:
11-
interval: monthly

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- alpine
1616
- android-armv7
1717
- android-arm64
18-
- centos7-devtoolset7
18+
- almalinux-devtoolset11
1919
- linux-armv6
2020
- linux-armv7
2121
- linux-armv7l-musl

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- alpine
1717
- android-armv7
1818
- android-arm64
19-
- centos7-devtoolset7
19+
- almalinux-devtoolset11
2020
- linux-armv6
2121
- linux-armv7
2222
- linux-armv7l-musl

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,21 @@ Images that are based on [`dockcross`](https://github.com/dockcross/dockcross) (
2929

3030
## Images
3131

32+
### [`almalinux-devtoolset11`](https://github.com/orgs/prebuild/packages/container/package/almalinux-devtoolset11)
33+
34+
Compile in AlmaLinux 8 with Red Hat Developer Toolset 11. This increases compatibility with Linux flavors because prebuilds will be compiled with GCC 11 but at runtime they will only require glibc 2.28. For comparison, compiling on Ubuntu 24.04 would require glibc 2.35.
35+
36+
Node.js binaries are built with a similar approach but the Node.js project uses RHEL 8 (which requires a Red Hat subscription) instead of AlmaLinux.
37+
38+
Preconfigures `prebuildify` to [tag](https://github.com/prebuild/prebuildify#options) prebuilds with the libc flavor, to set them apart from musl prebuilds, e.g. `linux-x64/node.glibc.node`.
39+
3240
### [`centos7-devtoolset7`](https://github.com/orgs/prebuild/packages/container/package/centos7-devtoolset7)
3341

34-
Compile in CentOS 7, as a better alternative to (commonly) Ubuntu 16.04 on Travis or GitHub Actions. Makes prebuilds compatible with Debian 8, Ubuntu 14.04, RHEL 7, CentOS 7 and other Linux flavors with an old glibc.
42+
_This image is not updated anymore and does not support Node.js 18 and C++ 20. Instead use `almalinux-devtoolset11`._
3543

36-
> The neat thing about this is that you get to compile with gcc 7 but glibc 2.17, so binaries are compatible for \[among others] Ubuntu 14.04 and Debian 8.
37-
>
38-
> The RHEL folks put in a ton of work to make the devtoolsets work on their older base systems (libc mainly), which involves shipping a delta library that contains the new stuff that can be statically linked in where it's used. We use this method for building Node binary releases.
44+
Compile in CentOS 7 with Red Hat Developer Toolset 7. This increases compatibility with Linux flavors because prebuilds will be compiled with GCC 7 but at runtime they will only require glibc 2.17. Makes prebuilds compatible with Debian 8, Ubuntu 14.04, RHEL 7, CentOS 7 and other Linux flavors with an old glibc.
45+
46+
> The RHEL folks put in a ton of work to make the devtoolsets work on their older base systems (libc mainly), which involves shipping a delta library that contains the new stuff that can be statically linked in where it's used.
3947
>
4048
> \-- <cite>[**@rvagg**](https://github.com/rvagg) ([prebuild/docker-images#8](https://github.com/prebuild/docker-images/pull/8))</cite>
4149

almalinux-devtoolset11/Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM almalinux:8-minimal
2+
3+
USER 0
4+
5+
# Need shadow-utils for groupadd and useradd
6+
# TODO: "source scl_source enable gcc-toolset-11" only applies to current session
7+
RUN curl -fsSL https://rpm.nodesource.com/setup_18.x | bash - && \
8+
microdnf install -y shadow-utils make nodejs python3 gcc-toolset-11 && \
9+
source scl_source enable gcc-toolset-11 && \
10+
ln -s python3 /usr/bin/python && \
11+
microdnf clean all && \
12+
rm -rf /var/cache/yum && \
13+
groupadd -g 1000 node && useradd -g 1000 -u 1000 -m node && \
14+
groupadd -g 2000 travis && useradd -g 2000 -u 2000 -m travis && \
15+
npm -v && \
16+
python --version
17+
18+
USER node
19+
ENV HOME /home/node
20+
21+
# Testing
22+
RUN gcc -dumpversion
23+
RUN echo -e '#include <stdio.h>\n#include <gnu/libc-version.h>\nint main(){printf("%u.%u\\n",__GLIBC__,__GLIBC_MINOR__);}' | gcc -xc++ -o dummy - && ./dummy
24+
25+
# Disable npm update check
26+
ENV NO_UPDATE_NOTIFIER true
27+
ENV npm_config_update_notifier false
28+
29+
WORKDIR /app

centos7-devtoolset7/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ USER 0
55
# Using Node.js 16 here instead of LTS because >= 18 doesn't support CentOS 7. See:
66
# - https://nodejs.org/en/blog/announcements/v18-release-announce/#toolchain-and-compiler-upgrades
77
# - https://github.com/prebuild/prebuildify-cross/issues/13
8+
#
9+
# Can no longer be built: mirrorlist.centos.org is offline.
810
RUN groupadd -g 1000 node && useradd -g 1000 -u 1000 -m node && \
911
groupadd -g 2000 travis && useradd -g 2000 -u 2000 -m travis && \
1012
curl -fsSL https://rpm.nodesource.com/setup_16.x | bash - && \

0 commit comments

Comments
 (0)