-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
40 lines (27 loc) · 1.15 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
ARG package=nodejs-current<24
ARG base_version=23
FROM minidocks/base:3.20 AS v20
FROM minidocks/base:3.20 AS v21
FROM minidocks/base:3.21 AS v22
FROM minidocks/base:3.21 AS v23
FROM v$base_version AS base
LABEL maintainer="Martin Hasoň <[email protected]>"
ARG package
RUN apk add $package && clean;
COPY rootfs /
CMD [ "node" ]
FROM base AS latest
LABEL maintainer="Martin Hasoň <[email protected]>"
ENV NPM_CONFIG_CACHE=/npm-cache \
NPM_CONFIG_UPDATE_NOTIFIER=false \
YARN_CACHE_FOLDER=/yarn-cache \
NODE_PATH=/node_modules \
CLEAN="$CLEAN:\$NPM_CONFIG_CACHE/:\$YARN_CACHE_FOLDER/"
ARG base_version
ARG package
# Fix https://github.com/npm/uid-number/issues/3#issuecomment-453727058
# Fix https://bobbyhadz.com/blog/javascript-chalk-error-err-require-esm-of-es-module
RUN /docker-entrypoint.d/10-cache.sh && apk add npm \
&& npm i -g "npm" corepack npm-check-updates && corepack prepare yarn@stable --activate \
&& if [ -d /usr/local/lib/node_modules ]; then local="local/"; apk del npm && rm -rf /usr/lib/node_modules; fi \
&& rm -rf "/usr/${local}lib/node_modules/npm/docs" "/usr/${local}lib/node_modules/npm/html" && clean