Skip to content

Commit 5161915

Browse files
committed
add: node 22 - lts
1 parent d861472 commit 5161915

6 files changed

Lines changed: 93 additions & 0 deletions

File tree

22/Dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM node:22-alpine
2+
3+
ENV ASUSER= \
4+
UID=0 \
5+
ENTRYPOINT=entrypoint.node.sh
6+
7+
WORKDIR /app
8+
9+
RUN adduser -D -u 1337 kool && deluser --remove-home node \
10+
# deps
11+
&& apk add --no-cache \
12+
bash \
13+
git \
14+
shadow \
15+
su-exec \
16+
curl \
17+
# build tools
18+
g++ \
19+
libpng-dev \
20+
make \
21+
zlib-dev \
22+
&& npm install -g pnpm \
23+
&& rm -rf rm -rf /root/.npm/* \
24+
# dockerize
25+
&& curl -L https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-alpine-linux-amd64-v0.6.1.tar.gz | tar xz \
26+
&& mv dockerize /usr/local/bin/dockerize
27+
28+
COPY root-npmrc /root/.npmrc
29+
COPY --chown=kool:kool kool-npmrc /home/kool/.npmrc
30+
COPY entrypoint /entrypoint
31+
32+
RUN chmod +x /entrypoint
33+
34+
RUN mkdir -p /usr/local/lib/node_modules && chmod -R 777 /usr/local/lib/node_modules
35+
36+
RUN npm i --location=global npm@latest
37+
38+
ENTRYPOINT [ "/entrypoint" ]

22/entrypoint

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Run as current user
5+
CURRENT_USER=${ASUSER:-${UID:-0}}
6+
7+
if [ ! -z "$CURRENT_USER" ] && [ "$CURRENT_USER" != "0" ]; then
8+
usermod -u $CURRENT_USER kool
9+
fi
10+
11+
# Run entrypoint if provided
12+
if [ ! -z "$ENTRYPOINT" ] && [ -f "$ENTRYPOINT" ]; then
13+
bash $ENTRYPOINT
14+
fi
15+
16+
if [ ! -z "$CURRENT_USER" ] && [ "$CURRENT_USER" != "0" ]; then
17+
exec su-exec kool "$@"
18+
else
19+
exec "$@"
20+
fi

22/kool-npmrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
scripts-prepend-node-path=true
2+
package-import-method=copy
3+
shamefully-hoist=true
4+
store-dir=/home/kool/.pnpm-store

22/root-npmrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
scripts-prepend-node-path=true
2+
package-import-method=copy
3+
shamefully-hoist=true
4+
store-dir=/root/.pnpm-store

fwd-template.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,31 @@
7575
"path": "template/root-npmrc"
7676
}
7777
]
78+
},
79+
{
80+
"name": "22",
81+
"data": {
82+
"from": "node:22-alpine",
83+
"version": "22"
84+
},
85+
"files": [
86+
{
87+
"name": "Dockerfile",
88+
"path": "template/Dockerfile"
89+
},
90+
{
91+
"name": "entrypoint",
92+
"path": "template/entrypoint"
93+
},
94+
{
95+
"name": "kool-npmrc",
96+
"path": "template/kool-npmrc"
97+
},
98+
{
99+
"name": "root-npmrc",
100+
"path": "template/root-npmrc"
101+
}
102+
]
78103
}
79104
]
80105
}

kool.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ scripts:
99
- docker build --pull -t kooldev/node:20 20
1010
# node 21
1111
- docker build --pull -t kooldev/node:21 21
12+
# node 22
13+
- docker build --pull -t kooldev/node:22 22

0 commit comments

Comments
 (0)