Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
load("//:checksums.bzl", "ARCHITECTURES", "BASE_ARCHITECTURES")
load("//base:distro.bzl", "DISTROS")
load("//private/oci:defs.bzl", "sign_and_push_all")
load("//nodejs:node_arch.bzl", "node_arch")

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

Expand Down Expand Up @@ -179,6 +180,7 @@ PYTHON3 |= {
NODEJS_VERSIONS = [
"20",
"22",
"24",
]

NODEJS_VARIATIONS = [
Expand All @@ -190,9 +192,9 @@ NODEJS_VARIATIONS = [

NODEJS = {
"{REGISTRY}/{PROJECT_ID}/nodejs" + version + "-" + distro + ":" + tag_base + "-" + arch: "//nodejs:nodejs" + version + label + "_" + user + "_" + arch + "_" + distro
for arch in ARCHITECTURES
for distro in DISTROS
for version in NODEJS_VERSIONS
for arch in node_arch(version)
for distro in DISTROS
for (tag_base, label, user) in NODEJS_VARIATIONS
}

Expand All @@ -206,8 +208,8 @@ NODEJS |= {

NODEJS |= {
"{REGISTRY}/{PROJECT_ID}/nodejs" + version + ":" + tag_base + "-" + arch: "//nodejs:nodejs" + version + label + "_" + user + "_" + arch + "_" + DEFAULT_DISTRO
for arch in ARCHITECTURES
for version in NODEJS_VERSIONS
for arch in node_arch(version)
for (tag_base, label, user) in NODEJS_VARIATIONS
}

Expand Down
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ include("//private/repos:java.MODULE.bazel")
### NODE ###
node = use_extension("//private/extensions:node.bzl", "node")
node.archive()
use_repo(node, "nodejs20_amd64", "nodejs20_arm", "nodejs20_arm64", "nodejs20_ppc64le", "nodejs20_s390x", "nodejs22_amd64", "nodejs22_arm", "nodejs22_arm64", "nodejs22_ppc64le", "nodejs22_s390x")
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")

### DEBIAN ###
include("//private/repos/deb:deb.MODULE.bazel")
64 changes: 62 additions & 2 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ The following images are currently published and updated by the distroless proje
| gcr.io/distroless/java21-debian12 | latest, nonroot, debug, debug-nonroot | amd64, arm64, ppc64le |
| gcr.io/distroless/nodejs20-debian12 | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |
| gcr.io/distroless/nodejs22-debian12 | latest, nonroot, debug, debug-nonroot | amd64, arm64, arm, s390x, ppc64le |
| gcr.io/distroless/nodejs24-debian12 | latest, nonroot, debug, debug-nonroot | amd64, arm64, s390x, ppc64le |

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`

Expand Down
2 changes: 1 addition & 1 deletion SUPPORT_POLICY.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The current estimation of end of life for images with the pattern:
Java will only support current LTS version distributed by debian [see here](https://wiki.debian.org/Java).

### Node
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).
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).

### Images no longer supported (TBD)
A list of supported image tags is available here: https://github.com/GoogleContainerTools/distroless#what-images-are-available
14 changes: 7 additions & 7 deletions nodejs/BUILD
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
load("@container_structure_test//:defs.bzl", "container_structure_test")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_image_index")
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("//:checksums.bzl", "ARCHITECTURES")
load("//base:distro.bzl", "DISTROS")
load("//nodejs:node_arch.bzl", "node_arch")

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

NODEJS_MAJOR_VERISONS = ("20", "22")
NODEJS_MAJOR_VERISONS = ("20", "22", "24")

MODE = [
"",
Expand All @@ -23,7 +23,7 @@ USER = [
name = "nodejs" + major_version + ("" if (not mode) else mode) + "_" + user + "_" + distro,
images = [
"nodejs" + major_version + ("" if (not mode) else mode) + "_" + user + "_" + arch + "_" + distro
for arch in ARCHITECTURES
for arch in node_arch(major_version)
],
)
for mode in MODE
Expand All @@ -44,7 +44,7 @@ USER = [
for mode in MODE
for user in USER
for major_version in NODEJS_MAJOR_VERISONS
for arch in ARCHITECTURES
for arch in node_arch(major_version)
for distro in DISTROS
]

Expand All @@ -65,7 +65,7 @@ USER = [
for mode in MODE
for user in USER
for major_version in NODEJS_MAJOR_VERISONS
for arch in ARCHITECTURES
for arch in node_arch(major_version)
for distro in DISTROS
]

Expand All @@ -85,7 +85,7 @@ pkg_tar(
for mode in MODE
for user in USER
for major_version in NODEJS_MAJOR_VERISONS
for arch in ARCHITECTURES
for arch in node_arch(major_version)
for distro in DISTROS
]

Expand All @@ -102,6 +102,6 @@ pkg_tar(
for mode in MODE
for user in USER
for major_version in NODEJS_MAJOR_VERISONS
for arch in ARCHITECTURES
for arch in node_arch(major_version)
for distro in DISTROS
]
1 change: 1 addition & 0 deletions nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Specifically, these images contain everything in the [base image](../base/README

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

## Usage

Expand Down
7 changes: 7 additions & 0 deletions nodejs/node_arch.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
load("//:checksums.bzl", "ARCHITECTURES")

# Function to filter architectures based on Node.js version
def node_arch(major_version):
if int(major_version) >= 24:
return [arch for arch in ARCHITECTURES if arch != "arm"]
return ARCHITECTURES
6 changes: 6 additions & 0 deletions nodejs/testdata/nodejs24.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
schemaVersion: "2.0.0"
commandTests:
- name: nodejs
command: "/nodejs/bin/node"
args: ["--version"]
expectedOutput: ["v24.0.0"]
44 changes: 44 additions & 0 deletions private/extensions/node.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,46 @@ def _node_impl(module_ctx):
control = "//nodejs:control",
)

node_archive(
name = "nodejs24_amd64",
sha256 = "b760ed6de40c35a25eb011b3cf5943d35d7a76f0c8c331d5a801e10925826cb3",
strip_prefix = "node-v24.0.0-linux-x64/",
urls = ["https://nodejs.org/dist/v24.0.0/node-v24.0.0-linux-x64.tar.gz"],
version = "24.0.0",
architecture = "amd64",
control = "//nodejs:control",
)

node_archive(
name = "nodejs24_arm64",
sha256 = "4104136ddd3d2f167d799f1b21bac72ccf500d80c24be849195f831df6371b83",
strip_prefix = "node-v24.0.0-linux-arm64/",
urls = ["https://nodejs.org/dist/v24.0.0/node-v24.0.0-linux-arm64.tar.gz"],
version = "24.0.0",
architecture = "arm64",
control = "//nodejs:control",
)

node_archive(
name = "nodejs24_ppc64le",
sha256 = "04654c22d8f9fc3021a27f37a95c16f820870908a49cd361f4cf74ed14509a10",
strip_prefix = "node-v24.0.0-linux-ppc64le/",
urls = ["https://nodejs.org/dist/v24.0.0/node-v24.0.0-linux-ppc64le.tar.gz"],
version = "24.0.0",
architecture = "ppc64le",
control = "//nodejs:control",
)

node_archive(
name = "nodejs24_s390x",
sha256 = "aa6fa7c5dc7d699116a39a781eb1685a68e3843d2d95bcd98527fd28922de63a",
strip_prefix = "node-v24.0.0-linux-s390x/",
urls = ["https://nodejs.org/dist/v24.0.0/node-v24.0.0-linux-s390x.tar.gz"],
version = "24.0.0",
architecture = "s390x",
control = "//nodejs:control",
)

return module_ctx.extension_metadata(
root_module_direct_deps = [
"nodejs20_amd64",
Expand All @@ -209,6 +249,10 @@ def _node_impl(module_ctx):
"nodejs22_arm",
"nodejs22_ppc64le",
"nodejs22_s390x",
"nodejs24_amd64",
"nodejs24_arm64",
"nodejs24_ppc64le",
"nodejs24_s390x",
],
root_module_direct_dev_deps = [],
)
Expand Down
Loading