Skip to content

Commit a5bd06d

Browse files
committed
Pin npm versions
1 parent d5b191b commit a5bd06d

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

json/Dockerfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,15 @@ ARG USER_HOME=/home/default
99
ARG USER_ID=1000
1010
ARG USER_GECOS=Default
1111

12-
# hadolint ignore=DL3016,DL3018
12+
# hadolint ignore=DL3018
1313
RUN apk --update --no-cache add \
1414
jose \
1515
jq \
1616
npm \
1717
openssl \
1818
py3-setuptools \
1919
py3-pip \
20-
&& rm -rf /var/cache/apk/* \
21-
&& npm install -g jsonlint \
22-
&& npm install -g prettyjson \
23-
&& npm install -g jwt-cli
20+
&& rm -rf /var/cache/apk/*
2421

2522
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
2623

@@ -33,6 +30,16 @@ RUN pip3 install --no-cache-dir --upgrade --break-system-packages \
3330
exit 1 ; \
3431
fi
3532

33+
RUN npm install -g \
34+
35+
36+
37+
&& msg="$(npm outdated --global | grep -i -e jsonlint -e jwt-cli -e prettyjson || true)" \
38+
&& if [ -n "${msg}" ]; then \
39+
>&2 echo "ERROR: outdated: ${msg}" ; \
40+
exit 1 ; \
41+
fi
42+
3643
RUN adduser \
3744
--home "${USER_HOME}" \
3845
--uid "${USER_ID}" \

0 commit comments

Comments
 (0)