File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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" ]
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 1+ scripts-prepend-node-path=true
2+ package-import-method=copy
3+ shamefully-hoist=true
4+ store-dir=/home/kool/.pnpm-store
Original file line number Diff line number Diff line change 1+ scripts-prepend-node-path=true
2+ package-import-method=copy
3+ shamefully-hoist=true
4+ store-dir=/root/.pnpm-store
Original file line number Diff line number Diff line change 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}
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments