Skip to content

Commit b146272

Browse files
authored
Merge pull request #636 from mcserep/docker-nodejs
Update NodeJS install method in Docker images
2 parents 965b16c + 0740384 commit b146272

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

docker/dev/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ RUN set -x && apt-get update -qq \
1111
cmake make \
1212
default-jdk \
1313
ctags \
14+
ca-certificates \
1415
curl \
16+
gnupg \
1517
doxygen \
1618
gcc-9 gcc-9-plugin-dev g++-9 \
1719
libboost-filesystem-dev \
@@ -32,8 +34,14 @@ RUN set -x && apt-get update -qq \
3234
ln -s /usr/bin/gcc-9 /usr/bin/gcc && \
3335
ln -s /usr/bin/g++-9 /usr/bin/g++
3436

35-
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - && \
36-
apt-get install -y nodejs
37+
# Install NodeJS from NodeSource.
38+
RUN mkdir -p /etc/apt/keyrings && \
39+
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
40+
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
41+
apt-get update -qq && \
42+
apt-get install -y nodejs && \
43+
apt-get clean && \
44+
rm -rf /var/lib/apt/lists/
3745

3846
# Build GTest.
3947
RUN cd /usr/src/googletest && \

docker/web/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,21 @@ RUN set -x && apt-get update -qq \
3232
# To switch user and exec command.
3333
gosu \
3434
tini \
35+
ca-certificates \
3536
curl \
37+
gnupg \
3638
&& apt-get clean \
3739
&& rm -rf /var/lib/apt/lists/ \
3840
&& set +x
3941

40-
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - && \
41-
apt-get install -y nodejs
42+
# Install NodeJS from NodeSource.
43+
RUN mkdir -p /etc/apt/keyrings && \
44+
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
45+
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
46+
apt-get update -qq && \
47+
apt-get install -y nodejs && \
48+
apt-get clean && \
49+
rm -rf /var/lib/apt/lists/
4250

4351
ARG CC_GID=960
4452
ARG CC_UID=960

0 commit comments

Comments
 (0)