Skip to content

Commit 43463fd

Browse files
committed
feat: Node.js 27.0.0-alpha.0.0.0
1 parent 4ec1f0f commit 43463fd

13 files changed

Lines changed: 509 additions & 0 deletions

File tree

‎27/alpine3.23/Dockerfile‎

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
FROM alpine:3.23
2+
3+
ENV NODE_VERSION=27.0.0-alpha.0.0.0
4+
5+
RUN addgroup -g 1000 node \
6+
&& adduser -u 1000 -G node -s /bin/sh -D node \
7+
&& apk add --no-cache \
8+
libatomic \
9+
libstdc++ \
10+
&& apk add --no-cache --virtual .build-deps \
11+
gnupg \
12+
curl \
13+
&& ARCH= OPENSSL_ARCH='linux*' && alpineArch="$(apk --print-arch)" \
14+
&& case "${alpineArch##*-}" in \
15+
x86_64) ARCH='x64' OPENSSL_ARCH=linux-x86_64;; \
16+
aarch64) OPENSSL_ARCH=linux-aarch64;; \
17+
*) echo "unsupported architecture"; exit 1 ;; \
18+
esac \
19+
# use pre-existing gpg directory, see https://github.com/nodejs/docker-node/pull/1895#issuecomment-1550389150
20+
&& export GNUPGHOME="$(mktemp -d)" \
21+
# gpg keys listed at https://github.com/nodejs/node#release-keys
22+
&& set -ex \
23+
&& for key in \
24+
5BE8A3F6C8A5C01D106C0AD820B1A390B168D356 \
25+
DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7 \
26+
CC68F5A3106FF448322E48ED27F5E38D5B0A215F \
27+
890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 \
28+
C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \
29+
108F52B48DB57BB0CC439B2997B01419BD92F80A \
30+
655F3B5C1FB3FA8D1A0CA6BDE4A7D232B936D2FD \
31+
A363A499291CBBC940DD62E41F10027AF002F8B0 \
32+
; do \
33+
{ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" && gpg --batch --fingerprint "$key"; } || \
34+
{ gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" && gpg --batch --fingerprint "$key"; } ; \
35+
done \
36+
&& if [ "$ARCH" = "x64" ]; then \
37+
curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" \
38+
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
39+
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
40+
&& gpgconf --kill all \
41+
&& rm -rf "$GNUPGHOME" \
42+
&& grep " node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
43+
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
44+
&& rm "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
45+
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs; \
46+
else \
47+
echo "Building from source" \
48+
&& apk add --no-cache --virtual .build-deps-full \
49+
binutils-gold \
50+
g++ \
51+
gcc \
52+
libgcc \
53+
linux-headers \
54+
make \
55+
python3 \
56+
py-setuptools \
57+
rust \
58+
cargo \
59+
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION.tar.xz" \
60+
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
61+
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
62+
&& gpgconf --kill all \
63+
&& rm -rf "$GNUPGHOME" \
64+
&& grep " node-v$NODE_VERSION.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
65+
&& tar -xf "node-v$NODE_VERSION.tar.xz" \
66+
&& cd "node-v$NODE_VERSION" \
67+
&& ./configure \
68+
&& make -j$(getconf _NPROCESSORS_ONLN) V= \
69+
&& make install \
70+
&& apk del .build-deps-full \
71+
&& cd .. \
72+
&& rm -Rf "node-v$NODE_VERSION" \
73+
&& rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt; \
74+
fi \
75+
# Remove unused OpenSSL headers to save ~34MB. See this NodeJS issue: https://github.com/nodejs/node/issues/46451
76+
&& find /usr/local/include/node/openssl/archs -mindepth 1 -maxdepth 1 ! -name "$OPENSSL_ARCH" -exec rm -rf {} \; \
77+
&& apk del .build-deps \
78+
# smoke tests
79+
&& node --version \
80+
&& npm --version \
81+
&& rm -rf /tmp/*
82+
83+
84+
COPY docker-entrypoint.sh /usr/local/bin/
85+
ENTRYPOINT ["docker-entrypoint.sh"]
86+
87+
CMD [ "node" ]

‎27/alpine3.23/docker-entrypoint.sh‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Run command with node if the first argument contains a "-" or is not a system command. The last
5+
# part inside the "{}" is a workaround for the following bug in ash/dash:
6+
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264
7+
if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then
8+
set -- node "$@"
9+
fi
10+
11+
exec "$@"

‎27/alpine3.24/Dockerfile‎

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
FROM alpine:3.24
2+
3+
ENV NODE_VERSION=27.0.0-alpha.0.0.0
4+
5+
RUN addgroup -g 1000 node \
6+
&& adduser -u 1000 -G node -s /bin/sh -D node \
7+
&& apk add --no-cache \
8+
libatomic \
9+
libstdc++ \
10+
&& apk add --no-cache --virtual .build-deps \
11+
gnupg \
12+
curl \
13+
&& ARCH= OPENSSL_ARCH='linux*' && alpineArch="$(apk --print-arch)" \
14+
&& case "${alpineArch##*-}" in \
15+
x86_64) ARCH='x64' OPENSSL_ARCH=linux-x86_64;; \
16+
aarch64) OPENSSL_ARCH=linux-aarch64;; \
17+
*) echo "unsupported architecture"; exit 1 ;; \
18+
esac \
19+
# use pre-existing gpg directory, see https://github.com/nodejs/docker-node/pull/1895#issuecomment-1550389150
20+
&& export GNUPGHOME="$(mktemp -d)" \
21+
# gpg keys listed at https://github.com/nodejs/node#release-keys
22+
&& set -ex \
23+
&& for key in \
24+
5BE8A3F6C8A5C01D106C0AD820B1A390B168D356 \
25+
DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7 \
26+
CC68F5A3106FF448322E48ED27F5E38D5B0A215F \
27+
890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 \
28+
C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \
29+
108F52B48DB57BB0CC439B2997B01419BD92F80A \
30+
655F3B5C1FB3FA8D1A0CA6BDE4A7D232B936D2FD \
31+
A363A499291CBBC940DD62E41F10027AF002F8B0 \
32+
; do \
33+
{ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" && gpg --batch --fingerprint "$key"; } || \
34+
{ gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" && gpg --batch --fingerprint "$key"; } ; \
35+
done \
36+
&& if [ "$ARCH" = "x64" ]; then \
37+
curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" \
38+
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
39+
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
40+
&& gpgconf --kill all \
41+
&& rm -rf "$GNUPGHOME" \
42+
&& grep " node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
43+
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
44+
&& rm "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
45+
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs; \
46+
else \
47+
echo "Building from source" \
48+
&& apk add --no-cache --virtual .build-deps-full \
49+
binutils-gold \
50+
g++ \
51+
gcc \
52+
libgcc \
53+
linux-headers \
54+
make \
55+
python3 \
56+
py-setuptools \
57+
rust \
58+
cargo \
59+
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION.tar.xz" \
60+
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
61+
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
62+
&& gpgconf --kill all \
63+
&& rm -rf "$GNUPGHOME" \
64+
&& grep " node-v$NODE_VERSION.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
65+
&& tar -xf "node-v$NODE_VERSION.tar.xz" \
66+
&& cd "node-v$NODE_VERSION" \
67+
&& ./configure \
68+
&& make -j$(getconf _NPROCESSORS_ONLN) V= \
69+
&& make install \
70+
&& apk del .build-deps-full \
71+
&& cd .. \
72+
&& rm -Rf "node-v$NODE_VERSION" \
73+
&& rm "node-v$NODE_VERSION.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt; \
74+
fi \
75+
# Remove unused OpenSSL headers to save ~34MB. See this NodeJS issue: https://github.com/nodejs/node/issues/46451
76+
&& find /usr/local/include/node/openssl/archs -mindepth 1 -maxdepth 1 ! -name "$OPENSSL_ARCH" -exec rm -rf {} \; \
77+
&& apk del .build-deps \
78+
# smoke tests
79+
&& node --version \
80+
&& npm --version \
81+
&& rm -rf /tmp/*
82+
83+
84+
COPY docker-entrypoint.sh /usr/local/bin/
85+
ENTRYPOINT ["docker-entrypoint.sh"]
86+
87+
CMD [ "node" ]

‎27/alpine3.24/docker-entrypoint.sh‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Run command with node if the first argument contains a "-" or is not a system command. The last
5+
# part inside the "{}" is a workaround for the following bug in ash/dash:
6+
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264
7+
if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then
8+
set -- node "$@"
9+
fi
10+
11+
exec "$@"

‎27/bookworm-slim/Dockerfile‎

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
FROM debian:bookworm-slim
2+
3+
RUN groupadd --gid 1000 node \
4+
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
5+
6+
ENV NODE_VERSION=27.0.0-alpha.0.0.0
7+
8+
RUN ARCH= OPENSSL_ARCH= && dpkgArch="$(dpkg --print-architecture)" \
9+
&& case "${dpkgArch##*-}" in \
10+
amd64) ARCH='x64' OPENSSL_ARCH='linux-x86_64';; \
11+
ppc64el) ARCH='ppc64le' OPENSSL_ARCH='linux-ppc64le';; \
12+
arm64) ARCH='arm64' OPENSSL_ARCH='linux-aarch64';; \
13+
*) echo "unsupported architecture"; exit 1 ;; \
14+
esac \
15+
&& set -ex \
16+
&& apt-get update && apt-get install -y ca-certificates curl wget gnupg dirmngr xz-utils libatomic1 --no-install-recommends \
17+
&& rm -rf /var/lib/apt/lists/* \
18+
# use pre-existing gpg directory, see https://github.com/nodejs/docker-node/pull/1895#issuecomment-1550389150
19+
&& export GNUPGHOME="$(mktemp -d)" \
20+
# gpg keys listed at https://github.com/nodejs/node#release-keys
21+
&& for key in \
22+
5BE8A3F6C8A5C01D106C0AD820B1A390B168D356 \
23+
DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7 \
24+
CC68F5A3106FF448322E48ED27F5E38D5B0A215F \
25+
890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 \
26+
C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \
27+
108F52B48DB57BB0CC439B2997B01419BD92F80A \
28+
655F3B5C1FB3FA8D1A0CA6BDE4A7D232B936D2FD \
29+
A363A499291CBBC940DD62E41F10027AF002F8B0 \
30+
; do \
31+
{ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" && gpg --batch --fingerprint "$key"; } || \
32+
{ gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" && gpg --batch --fingerprint "$key"; } ; \
33+
done \
34+
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
35+
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
36+
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
37+
&& gpgconf --kill all \
38+
&& rm -rf "$GNUPGHOME" \
39+
&& grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
40+
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
41+
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
42+
# Remove unused OpenSSL headers to save ~34MB. See this NodeJS issue: https://github.com/nodejs/node/issues/46451
43+
&& find /usr/local/include/node/openssl/archs -mindepth 1 -maxdepth 1 ! -name "$OPENSSL_ARCH" -exec rm -rf {} \; \
44+
&& apt-mark auto '.*' > /dev/null \
45+
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
46+
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
47+
| sort -u \
48+
| xargs -r dpkg-query --search \
49+
| cut -d: -f1 \
50+
| sort -u \
51+
| xargs -r apt-mark manual \
52+
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
53+
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
54+
# smoke tests
55+
&& node --version \
56+
&& npm --version \
57+
&& rm -rf /tmp/*
58+
59+
60+
COPY docker-entrypoint.sh /usr/local/bin/
61+
ENTRYPOINT ["docker-entrypoint.sh"]
62+
63+
CMD [ "node" ]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Run command with node if the first argument contains a "-" or is not a system command. The last
5+
# part inside the "{}" is a workaround for the following bug in ash/dash:
6+
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264
7+
if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then
8+
set -- node "$@"
9+
fi
10+
11+
exec "$@"

‎27/bookworm/Dockerfile‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
FROM buildpack-deps:bookworm
2+
3+
RUN groupadd --gid 1000 node \
4+
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
5+
6+
ENV NODE_VERSION=27.0.0-alpha.0.0.0
7+
8+
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
9+
&& case "${dpkgArch##*-}" in \
10+
amd64) ARCH='x64';; \
11+
ppc64el) ARCH='ppc64le';; \
12+
arm64) ARCH='arm64';; \
13+
*) echo "unsupported architecture"; exit 1 ;; \
14+
esac \
15+
# use pre-existing gpg directory, see https://github.com/nodejs/docker-node/pull/1895#issuecomment-1550389150
16+
&& export GNUPGHOME="$(mktemp -d)" \
17+
# gpg keys listed at https://github.com/nodejs/node#release-keys
18+
&& set -ex \
19+
&& for key in \
20+
5BE8A3F6C8A5C01D106C0AD820B1A390B168D356 \
21+
DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7 \
22+
CC68F5A3106FF448322E48ED27F5E38D5B0A215F \
23+
890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 \
24+
C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \
25+
108F52B48DB57BB0CC439B2997B01419BD92F80A \
26+
655F3B5C1FB3FA8D1A0CA6BDE4A7D232B936D2FD \
27+
A363A499291CBBC940DD62E41F10027AF002F8B0 \
28+
; do \
29+
{ gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" && gpg --batch --fingerprint "$key"; } || \
30+
{ gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" && gpg --batch --fingerprint "$key"; } ; \
31+
done \
32+
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
33+
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
34+
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
35+
&& gpgconf --kill all \
36+
&& rm -rf "$GNUPGHOME" \
37+
&& grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
38+
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
39+
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
40+
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
41+
# smoke tests
42+
&& node --version \
43+
&& npm --version \
44+
&& rm -rf /tmp/*
45+
46+
47+
COPY docker-entrypoint.sh /usr/local/bin/
48+
ENTRYPOINT ["docker-entrypoint.sh"]
49+
50+
CMD [ "node" ]

‎27/bookworm/docker-entrypoint.sh‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Run command with node if the first argument contains a "-" or is not a system command. The last
5+
# part inside the "{}" is a workaround for the following bug in ash/dash:
6+
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264
7+
if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then
8+
set -- node "$@"
9+
fi
10+
11+
exec "$@"

0 commit comments

Comments
 (0)