Skip to content

Commit f9a9ff8

Browse files
authored
Merge pull request #1794 from omBratteng/add-node-24
Add node24
2 parents b0760c3 + 381f871 commit f9a9ff8

File tree

10 files changed

+135
-14
lines changed

10 files changed

+135
-14
lines changed

BUILD

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
load("//:checksums.bzl", "ARCHITECTURES", "BASE_ARCHITECTURES")
22
load("//base:distro.bzl", "DISTROS")
33
load("//private/oci:defs.bzl", "sign_and_push_all")
4+
load("//nodejs:node_arch.bzl", "node_arch")
45

56
package(default_visibility = ["//visibility:public"])
67

@@ -179,6 +180,7 @@ PYTHON3 |= {
179180
NODEJS_VERSIONS = [
180181
"20",
181182
"22",
183+
"24",
182184
]
183185

184186
NODEJS_VARIATIONS = [
@@ -190,9 +192,9 @@ NODEJS_VARIATIONS = [
190192

191193
NODEJS = {
192194
"{REGISTRY}/{PROJECT_ID}/nodejs" + version + "-" + distro + ":" + tag_base + "-" + arch: "//nodejs:nodejs" + version + label + "_" + user + "_" + arch + "_" + distro
193-
for arch in ARCHITECTURES
194-
for distro in DISTROS
195195
for version in NODEJS_VERSIONS
196+
for arch in node_arch(version)
197+
for distro in DISTROS
196198
for (tag_base, label, user) in NODEJS_VARIATIONS
197199
}
198200

@@ -206,8 +208,8 @@ NODEJS |= {
206208

207209
NODEJS |= {
208210
"{REGISTRY}/{PROJECT_ID}/nodejs" + version + ":" + tag_base + "-" + arch: "//nodejs:nodejs" + version + label + "_" + user + "_" + arch + "_" + DEFAULT_DISTRO
209-
for arch in ARCHITECTURES
210211
for version in NODEJS_VERSIONS
212+
for arch in node_arch(version)
211213
for (tag_base, label, user) in NODEJS_VARIATIONS
212214
}
213215

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ include("//private/repos:java.MODULE.bazel")
5858
### NODE ###
5959
node = use_extension("//private/extensions:node.bzl", "node")
6060
node.archive()
61-
use_repo(node, "nodejs20_amd64", "nodejs20_arm", "nodejs20_arm64", "nodejs20_ppc64le", "nodejs20_s390x", "nodejs22_amd64", "nodejs22_arm", "nodejs22_arm64", "nodejs22_ppc64le", "nodejs22_s390x")
61+
use_repo(node, "nodejs20_amd64", "nodejs20_arm", "nodejs20_arm64", "nodejs20_ppc64le", "nodejs20_s390x", "nodejs22_amd64", "nodejs22_arm", "nodejs22_arm64", "nodejs22_ppc64le", "nodejs22_s390x", "nodejs24_amd64", "nodejs24_arm64", "nodejs24_ppc64le", "nodejs24_s390x")
6262

6363
### DEBIAN ###
6464
include("//private/repos/deb:deb.MODULE.bazel")

MODULE.bazel.lock

Lines changed: 62 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ The following images are currently published and updated by the distroless proje
4242
| gcr.io/distroless/java21-debian12 | latest, nonroot, debug, debug-nonroot | amd64, arm64, ppc64le |
4343
| gcr.io/distroless/nodejs20-debian12 | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |
4444
| gcr.io/distroless/nodejs22-debian12 | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |
45+
| gcr.io/distroless/nodejs24-debian12 | latest, nonroot, debug, debug-nonroot | amd64, arm64, s390x, ppc64le |
4546

4647
These images refer to image indexes with references to all supported architectures. Architecture specific images can be directly referenced using an additional architecture suffix on the tag, like `gcr.io/distroless/static-debian12:latest-amd64`
4748

SUPPORT_POLICY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The current estimation of end of life for images with the pattern:
2121
Java will only support current LTS version distributed by debian [see here](https://wiki.debian.org/Java).
2222

2323
### Node
24-
Node version support is for even numbered releases (20, 22, etc) that are current, active or in LTS maintenance. For more information, [see here](https://nodejs.org/en/about/previous-releases#release-schedule).
24+
Node version support is for even numbered releases (20, 22, 24, etc) that are current, active or in LTS maintenance. For more information, [see here](https://nodejs.org/en/about/previous-releases#release-schedule).
2525

2626
### Images no longer supported (TBD)
2727
A list of supported image tags is available here: https://github.com/GoogleContainerTools/distroless#what-images-are-available

nodejs/BUILD

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
load("@container_structure_test//:defs.bzl", "container_structure_test")
22
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_image_index")
33
load("@rules_pkg//:pkg.bzl", "pkg_tar")
4-
load("//:checksums.bzl", "ARCHITECTURES")
54
load("//base:distro.bzl", "DISTROS")
5+
load("//nodejs:node_arch.bzl", "node_arch")
66

77
package(default_visibility = ["//visibility:public"])
88

9-
NODEJS_MAJOR_VERISONS = ("20", "22")
9+
NODEJS_MAJOR_VERISONS = ("20", "22", "24")
1010

1111
MODE = [
1212
"",
@@ -23,7 +23,7 @@ USER = [
2323
name = "nodejs" + major_version + ("" if (not mode) else mode) + "_" + user + "_" + distro,
2424
images = [
2525
"nodejs" + major_version + ("" if (not mode) else mode) + "_" + user + "_" + arch + "_" + distro
26-
for arch in ARCHITECTURES
26+
for arch in node_arch(major_version)
2727
],
2828
)
2929
for mode in MODE
@@ -44,7 +44,7 @@ USER = [
4444
for mode in MODE
4545
for user in USER
4646
for major_version in NODEJS_MAJOR_VERISONS
47-
for arch in ARCHITECTURES
47+
for arch in node_arch(major_version)
4848
for distro in DISTROS
4949
]
5050

@@ -65,7 +65,7 @@ USER = [
6565
for mode in MODE
6666
for user in USER
6767
for major_version in NODEJS_MAJOR_VERISONS
68-
for arch in ARCHITECTURES
68+
for arch in node_arch(major_version)
6969
for distro in DISTROS
7070
]
7171

@@ -85,7 +85,7 @@ pkg_tar(
8585
for mode in MODE
8686
for user in USER
8787
for major_version in NODEJS_MAJOR_VERISONS
88-
for arch in ARCHITECTURES
88+
for arch in node_arch(major_version)
8989
for distro in DISTROS
9090
]
9191

@@ -102,6 +102,6 @@ pkg_tar(
102102
for mode in MODE
103103
for user in USER
104104
for major_version in NODEJS_MAJOR_VERISONS
105-
for arch in ARCHITECTURES
105+
for arch in node_arch(major_version)
106106
for distro in DISTROS
107107
]

nodejs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Specifically, these images contain everything in the [base image](../base/README
88

99
- Node.js v20 (`gcr.io/distroless/nodejs20-debian12`) and its dependencies.
1010
- Node.js v22 (`gcr.io/distroless/nodejs22-debian12`) and its dependencies.
11+
- Node.js v24 (`gcr.io/distroless/nodejs24-debian12`) and its dependencies.
1112

1213
## Usage
1314

nodejs/node_arch.bzl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
load("//:checksums.bzl", "ARCHITECTURES")
2+
3+
# Function to filter architectures based on Node.js version
4+
def node_arch(major_version):
5+
if int(major_version) >= 24:
6+
return [arch for arch in ARCHITECTURES if arch != "arm"]
7+
return ARCHITECTURES

nodejs/testdata/nodejs24.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
schemaVersion: "2.0.0"
2+
commandTests:
3+
- name: nodejs
4+
command: "/nodejs/bin/node"
5+
args: ["--version"]
6+
expectedOutput: ["v24.0.0"]

private/extensions/node.bzl

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,46 @@ def _node_impl(module_ctx):
197197
control = "//nodejs:control",
198198
)
199199

200+
node_archive(
201+
name = "nodejs24_amd64",
202+
sha256 = "b760ed6de40c35a25eb011b3cf5943d35d7a76f0c8c331d5a801e10925826cb3",
203+
strip_prefix = "node-v24.0.0-linux-x64/",
204+
urls = ["https://nodejs.org/dist/v24.0.0/node-v24.0.0-linux-x64.tar.gz"],
205+
version = "24.0.0",
206+
architecture = "amd64",
207+
control = "//nodejs:control",
208+
)
209+
210+
node_archive(
211+
name = "nodejs24_arm64",
212+
sha256 = "4104136ddd3d2f167d799f1b21bac72ccf500d80c24be849195f831df6371b83",
213+
strip_prefix = "node-v24.0.0-linux-arm64/",
214+
urls = ["https://nodejs.org/dist/v24.0.0/node-v24.0.0-linux-arm64.tar.gz"],
215+
version = "24.0.0",
216+
architecture = "arm64",
217+
control = "//nodejs:control",
218+
)
219+
220+
node_archive(
221+
name = "nodejs24_ppc64le",
222+
sha256 = "04654c22d8f9fc3021a27f37a95c16f820870908a49cd361f4cf74ed14509a10",
223+
strip_prefix = "node-v24.0.0-linux-ppc64le/",
224+
urls = ["https://nodejs.org/dist/v24.0.0/node-v24.0.0-linux-ppc64le.tar.gz"],
225+
version = "24.0.0",
226+
architecture = "ppc64le",
227+
control = "//nodejs:control",
228+
)
229+
230+
node_archive(
231+
name = "nodejs24_s390x",
232+
sha256 = "aa6fa7c5dc7d699116a39a781eb1685a68e3843d2d95bcd98527fd28922de63a",
233+
strip_prefix = "node-v24.0.0-linux-s390x/",
234+
urls = ["https://nodejs.org/dist/v24.0.0/node-v24.0.0-linux-s390x.tar.gz"],
235+
version = "24.0.0",
236+
architecture = "s390x",
237+
control = "//nodejs:control",
238+
)
239+
200240
return module_ctx.extension_metadata(
201241
root_module_direct_deps = [
202242
"nodejs20_amd64",
@@ -209,6 +249,10 @@ def _node_impl(module_ctx):
209249
"nodejs22_arm",
210250
"nodejs22_ppc64le",
211251
"nodejs22_s390x",
252+
"nodejs24_amd64",
253+
"nodejs24_arm64",
254+
"nodejs24_ppc64le",
255+
"nodejs24_s390x",
212256
],
213257
root_module_direct_dev_deps = [],
214258
)

0 commit comments

Comments
 (0)