File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,19 @@ FROM node:${VARIANT}
44
55ARG USERNAME=node
66
7- # Install eslint
8- RUN su ${USERNAME} -c "umask 0002 && npm install -g eslint" \
7+ RUN \
8+ # Configure global npm install location, use group to adapt to UID/GID changes
9+ if ! cat /etc/group | grep -e "^npm:" > /dev/null 2>&1; then groupadd -r npm; fi \
10+ && usermod -a -G npm ${USERNAME} \
11+ && umask 0002 \
12+ && mkdir -p ${NPM_GLOBAL} \
13+ && touch /usr/local/etc/npmrc \
14+ && chown ${USERNAME}:npm ${NPM_GLOBAL} /usr/local/etc/npmrc \
15+ && chmod g+s ${NPM_GLOBAL} \
16+ && npm config -g set prefix ${NPM_GLOBAL} \
17+ && sudo -u ${USERNAME} npm config -g set prefix ${NPM_GLOBAL} \
18+ # Install eslint
19+ && su ${USERNAME} -c "umask 0002 && npm install -g eslint" \
920 && npm cache clean --force > /dev/null 2>&1
1021
1122# [Optional] Uncomment this section to install additional OS packages.
You can’t perform that action at this time.
0 commit comments