Skip to content

Commit 67d4cd7

Browse files
Add Node debian core variant
1 parent b016843 commit 67d4cd7

24 files changed

+309
-5
lines changed

.github/workflows/build-test.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ jobs:
6868
- name: Checkout
6969
uses: actions/checkout@v4
7070

71+
- name: Build core base image
72+
if: ${{ endsWith(matrix.variant, '-core') }}
73+
uses: docker/build-push-action@v5
74+
with:
75+
push: false
76+
load: true
77+
context: .
78+
file: ./${{ steps.short-version.outputs.result }}/${{ matrix.base }}/Dockerfile
79+
tags: node:${{ matrix.version }}-${{ matrix.base }}
80+
7181
- name: Build image
7282
uses: docker/build-push-action@v5
7383
with:
@@ -91,7 +101,9 @@ jobs:
91101
[ "${output}" = 'success' ]
92102
93103
- name: Test for npm
104+
if: ${{ ! endsWith(matrix.variant, '-core') }}
94105
run: docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} npm --version
95106

96107
- name: Test for yarn
108+
if: ${{ ! endsWith(matrix.variant, '-core') }}
97109
run: docker run --rm node:${{ matrix.version }}-${{ matrix.variant }} yarn --version

18/bookworm-core/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM debian:bookworm-slim
2+
3+
RUN groupadd --gid 1000 node \
4+
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
5+
6+
ENV NODE_VERSION 18.20.1
7+
8+
COPY --from=node:18.20.1-bookworm-slim --link /usr/local/bin/ /usr/local/bin/
9+
COPY --from=node:18.20.1-bookworm-slim --link /usr/local/include/node/ /usr/local/include/node/
10+
11+
ENTRYPOINT ["docker-entrypoint.sh"]
12+
13+
CMD [ "node" ]

18/bookworm-core/docker-entrypoint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Run command with node if the first argument contains a "-" or is not a system command. The last
5+
# part inside the "{}" is a workaround for the following bug in ash/dash:
6+
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264
7+
if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then
8+
set -- node "$@"
9+
fi
10+
11+
exec "$@"

18/bullseye-core/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM debian:bullseye-slim
2+
3+
RUN groupadd --gid 1000 node \
4+
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
5+
6+
ENV NODE_VERSION 18.20.1
7+
8+
COPY --from=node:18.20.1-bullseye-slim --link /usr/local/bin/ /usr/local/bin/
9+
COPY --from=node:18.20.1-bullseye-slim --link /usr/local/include/node/ /usr/local/include/node/
10+
11+
ENTRYPOINT ["docker-entrypoint.sh"]
12+
13+
CMD [ "node" ]

18/bullseye-core/docker-entrypoint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Run command with node if the first argument contains a "-" or is not a system command. The last
5+
# part inside the "{}" is a workaround for the following bug in ash/dash:
6+
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264
7+
if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then
8+
set -- node "$@"
9+
fi
10+
11+
exec "$@"

18/buster-core/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM debian:buster-slim
2+
3+
RUN groupadd --gid 1000 node \
4+
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
5+
6+
ENV NODE_VERSION 18.20.1
7+
8+
COPY --from=node:18.20.1-buster-slim --link /usr/local/bin/ /usr/local/bin/
9+
COPY --from=node:18.20.1-buster-slim --link /usr/local/include/node/ /usr/local/include/node/
10+
11+
ENTRYPOINT ["docker-entrypoint.sh"]
12+
13+
CMD [ "node" ]

18/buster-core/docker-entrypoint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Run command with node if the first argument contains a "-" or is not a system command. The last
5+
# part inside the "{}" is a workaround for the following bug in ash/dash:
6+
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264
7+
if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then
8+
set -- node "$@"
9+
fi
10+
11+
exec "$@"

20/bookworm-core/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM debian:bookworm-slim
2+
3+
RUN groupadd --gid 1000 node \
4+
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
5+
6+
ENV NODE_VERSION 20.12.1
7+
8+
COPY --from=node:20.12.1-bookworm-slim --link /usr/local/bin/ /usr/local/bin/
9+
COPY --from=node:20.12.1-bookworm-slim --link /usr/local/include/node/ /usr/local/include/node/
10+
11+
ENTRYPOINT ["docker-entrypoint.sh"]
12+
13+
CMD [ "node" ]

20/bookworm-core/docker-entrypoint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Run command with node if the first argument contains a "-" or is not a system command. The last
5+
# part inside the "{}" is a workaround for the following bug in ash/dash:
6+
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264
7+
if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then
8+
set -- node "$@"
9+
fi
10+
11+
exec "$@"

20/bullseye-core/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM debian:bullseye-slim
2+
3+
RUN groupadd --gid 1000 node \
4+
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
5+
6+
ENV NODE_VERSION 20.12.1
7+
8+
COPY --from=node:20.12.1-bullseye-slim --link /usr/local/bin/ /usr/local/bin/
9+
COPY --from=node:20.12.1-bullseye-slim --link /usr/local/include/node/ /usr/local/include/node/
10+
11+
ENTRYPOINT ["docker-entrypoint.sh"]
12+
13+
CMD [ "node" ]

0 commit comments

Comments
 (0)