Skip to content

Commit 2aa26d1

Browse files
committed
Add nodejs20
Signed-off-by: Sora Morimoto <[email protected]>
1 parent 7625263 commit 2aa26d1

File tree

10 files changed

+36
-6
lines changed

10 files changed

+36
-6
lines changed

BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ NODEJS_VERSIONS = [
199199
"14",
200200
"16",
201201
"18",
202+
"20",
202203
]
203204

204205
NODEJS_VARIATIONS = [

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ The following images are currently published and updated by the distroless proje
4141
| gcr.io/distroless/nodejs14-debian11 | latest, nonroot, debug, debug-nonroot |
4242
| gcr.io/distroless/nodejs16-debian11 | latest, nonroot, debug, debug-nonroot |
4343
| gcr.io/distroless/nodejs18-debian11 | latest, nonroot, debug, debug-nonroot |
44+
| gcr.io/distroless/nodejs20-debian11 | latest, nonroot, debug, debug-nonroot |
4445

4546
Any other tags are considered deprecated and are no longer updated
4647

@@ -104,6 +105,7 @@ Follow these steps to get started:
104105
* [gcr.io/distroless/nodejs14-debian11](nodejs/README.md)
105106
* [gcr.io/distroless/nodejs16-debian11](nodejs/README.md)
106107
* [gcr.io/distroless/nodejs18-debian11](nodejs/README.md)
108+
* [gcr.io/distroless/nodejs20-debian11](nodejs/README.md)
107109

108110
* The following images are also published on `gcr.io`, but are considered experimental and not recommended for production usage:
109111
* [gcr.io/distroless/python3-debian11](experimental/python3/README.md)

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 (14, 16, 18, etc) that are current, active or in LTS maintenance. For more information, [see here](https://nodejs.org/en/about/releases/).
24+
Node version support is for even numbered releases (14, 16, 18, 20, etc) that are current, active or in LTS maintenance. For more information, [see here](https://nodejs.org/en/about/releases/).
2525

2626
### Python
2727
Python support is experimental, and this project does not make any guarantees about the version of python in images.

examples/nodejs/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM node:18 AS build-env
1+
FROM node:20 AS build-env
22
COPY . /app
33
WORKDIR /app
44

55
RUN npm ci --omit=dev
66

7-
FROM gcr.io/distroless/nodejs18-debian11
7+
FROM gcr.io/distroless/nodejs20-debian11
88
COPY --from=build-env /app /app
99
WORKDIR /app
1010
CMD ["hello.js"]

examples/nodejs/node-express/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM node:18 AS build-env
1+
FROM node:20 AS build-env
22
ADD . /app
33
WORKDIR /app
44
RUN npm install --omit=dev
55

6-
FROM gcr.io/distroless/nodejs18-debian11
6+
FROM gcr.io/distroless/nodejs20-debian11
77
COPY --from=build-env /app /app
88
WORKDIR /app
99
EXPOSE 3000

node-v20.0.0-linux-arm64.tar.gz

43.6 MB
Binary file not shown.

node_archives.bzl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ def repositories():
3333
control = "//nodejs:control",
3434
)
3535

36+
node_archive(
37+
name = "nodejs20_amd64",
38+
sha256 = "95439a0a836fc858565c7b6a7b1e55d1741901e6f205485e496abbefe973cfce",
39+
strip_prefix = "node-v20.0.0-linux-x64/",
40+
urls = ["https://nodejs.org/dist/v20.0.0/node-v20.0.0-linux-x64.tar.gz"],
41+
version = "20.0.0",
42+
architecture = "amd64",
43+
control = "//nodejs:control",
44+
)
45+
3646
node_archive(
3747
name = "nodejs14_arm64",
3848
sha256 = "044b7ec3fea04cd3815d26901ee37203dcc942688b72ee6eac96f6a1ca3cc63f",
@@ -62,3 +72,13 @@ def repositories():
6272
architecture = "arm64",
6373
control = "//nodejs:control",
6474
)
75+
76+
node_archive(
77+
name = "nodejs20_arm64",
78+
sha256 = "997ddc7ca941280aeb357d4ad40ea7f93cb4d7989b93056dbf1b42a1a89b449b",
79+
strip_prefix = "node-v20.0.0-linux-arm64/",
80+
urls = ["https://nodejs.org/dist/v20.0.0/node-v20.0.0-linux-arm64.tar.gz"],
81+
version = "20.0.0",
82+
architecture = "arm64",
83+
control = "//nodejs:control",
84+
)

nodejs/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ load("@rules_pkg//:pkg.bzl", "pkg_tar")
55

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

8-
NODEJS_MAJOR_VERISONS = ("14", "16", "18")
8+
NODEJS_MAJOR_VERISONS = ("14", "16", "18", "20")
99

1010
MODE = [
1111
"",

nodejs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Specifically, these images contain everything in the [base image](../base/README
99
- Node.js v14 (`gcr.io/distroless/nodejs14-debian11`) and its dependencies.
1010
- Node.js v16 (`gcr.io/distroless/nodejs16-debian11`) and its dependencies.
1111
- Node.js v18 (`gcr.io/distroless/nodejs18-debian11`) and its dependencies.
12+
- Node.js v20 (`gcr.io/distroless/nodejs20-debian11`) and its dependencies.
1213

1314
## Usage
1415

nodejs/testdata/nodejs20.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: ["v20.0.0"]

0 commit comments

Comments
 (0)