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:21-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 5050 "path" : " template/root-npmrc"
5151 }
5252 ]
53+ },
54+ {
55+ "name" : " 21" ,
56+ "data" : {
57+ "from" : " node:21-alpine" ,
58+ "version" : " 21"
59+ },
60+ "files" : [
61+ {
62+ "name" : " Dockerfile" ,
63+ "path" : " template/Dockerfile"
64+ },
65+ {
66+ "name" : " entrypoint" ,
67+ "path" : " template/entrypoint"
68+ },
69+ {
70+ "name" : " kool-npmrc" ,
71+ "path" : " template/kool-npmrc"
72+ },
73+ {
74+ "name" : " root-npmrc" ,
75+ "path" : " template/root-npmrc"
76+ }
77+ ]
5378 }
5479 ]
5580}
Original file line number Diff line number Diff line change 77 - docker build --pull -t kooldev/node:18 18
88 # node 20
99 - docker build --pull -t kooldev/node:20 20
10+ # node 21
11+ - docker build --pull -t kooldev/node:21 21
You can’t perform that action at this time.
0 commit comments