Skip to content

Commit 15df91a

Browse files
committed
feat(node-distroless): add node-distroless image combines google distroless and dump-init
1 parent a99d80f commit 15df91a

File tree

5 files changed

+66
-1
lines changed

5 files changed

+66
-1
lines changed

images/node-distroless/Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM node:22-alpine AS init
2+
RUN apk add --no-cache dumb-init
3+
4+
FROM gcr.io/distroless/nodejs22:latest AS runtime
5+
COPY --from=init /usr/bin/dumb-init /usr/bin/dumb-init
6+
ENTRYPOINT [ "/usr/bin/dumb-init", "--", "/nodejs/bin/node" ]

images/node-distroless/README.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# node-distroless
2+
3+
This image combines the compactness and security of distroless with the convenience of dumb-init for process management, making Node.js applications run more stably in a container environment.
4+
5+
> This image is maintained with node latest LTS version
6+
7+
## Usage
8+
9+
The simple usage example
10+
11+
```dockerfile
12+
FROM ghcr.io/ebizbase/node-distroless
13+
WORKDIR /usr/src/app
14+
COPY . .
15+
CMD [ "index.js" ]
16+
```

images/node-distroless/project.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "node-distroless",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"projectType": "library",
5+
"metadata": {
6+
"version": "0.0.0"
7+
},
8+
"tags": [],
9+
"targets": {
10+
"build": {
11+
"executor": "@ebizbase/nx-docker:build",
12+
"options": {
13+
"tags": ["node-distroless:edge"],
14+
"outputs": ["type=docker"]
15+
}
16+
},
17+
"test": {
18+
"dependsOn": ["build"],
19+
"executor": "nx:run-commands",
20+
"options": {
21+
"command": "docker run --rm node-distroless:edge -e 'console.log(process.version)'"
22+
}
23+
},
24+
"publish": {
25+
"executor": "@ebizbase/nx-docker:build",
26+
"options": {
27+
"tags": ["ghcr.io/ebizbase/node-distroless"],
28+
"outputs": ["type=image"]
29+
}
30+
}
31+
}
32+
}

release-config.json

+10
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,16 @@
103103
"jsonpath": "$.metadata.version"
104104
}
105105
]
106+
},
107+
"images/node-distroless": {
108+
"package-name": "node-distroless",
109+
"extra-files": [
110+
{
111+
"type": "json",
112+
"path": "project.json",
113+
"jsonpath": "$.metadata.version"
114+
}
115+
]
106116
}
107117
}
108118
}

release-manifest.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
"devcontainer-images/node-devcontainer": "1.0.0",
1111
"devcontainer-images/node-dind-devcontainer": "1.0.0",
1212
"devcontainer-images/node-dind-playwright-devcontainer": "1.0.0",
13-
"devcontainer-images/node-playwright-devcontainer": "1.0.0"
13+
"devcontainer-images/node-playwright-devcontainer": "1.0.0",
14+
"images/node-distroless": "0.0.0"
1415
}

0 commit comments

Comments
 (0)