-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(node-distroless): add node-distroless image combines google dist…
…roless and dump-init
- Loading branch information
Showing
5 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM node:22-alpine AS init | ||
RUN apk add --no-cache dumb-init | ||
|
||
FROM gcr.io/distroless/nodejs22:latest AS runtime | ||
COPY --from=init /usr/bin/dumb-init /usr/bin/dumb-init | ||
ENTRYPOINT [ "/usr/bin/dumb-init", "--", "/nodejs/bin/node" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# node-distroless | ||
|
||
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. | ||
|
||
> This image is maintained with node latest LTS version | ||
## Usage | ||
|
||
The simple usage example | ||
|
||
```dockerfile | ||
FROM ghcr.io/ebizbase/node-distroless | ||
WORKDIR /usr/src/app | ||
COPY . . | ||
CMD [ "index.js" ] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "node-distroless", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"projectType": "library", | ||
"metadata": { | ||
"version": "0.0.0" | ||
}, | ||
"tags": [], | ||
"targets": { | ||
"build": { | ||
"executor": "@ebizbase/nx-docker:build", | ||
"options": { | ||
"tags": ["node-distroless:edge"], | ||
"outputs": ["type=docker"] | ||
} | ||
}, | ||
"test": { | ||
"dependsOn": ["build"], | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"command": "docker run --rm node-distroless:edge -e 'console.log(process.version)'" | ||
} | ||
}, | ||
"publish": { | ||
"executor": "@ebizbase/nx-docker:build", | ||
"options": { | ||
"tags": ["ghcr.io/ebizbase/node-distroless"], | ||
"outputs": ["type=image"] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters