Skip to content

Commit 740ed15

Browse files
committed
chore: update nodejs installation process
Based on the deprecation message that stalls docker builds for 60 seconds: 19 0.273 ================================================================================ 19 0.273 19 0.273 SCRIPT DEPRECATION WARNING 19 0.273 19 0.273 19 0.273 This script, located at https://deb.nodesource.com/setup_X, used to 19 0.273 install Node.js is deprecated now and will eventually be made inactive. 19 0.273 19 0.273 Please visit the NodeSource distributions Github and follow the 19 0.273 instructions to migrate your repo. 19 0.273 https://github.com/~/distributions 19 0.273 19 0.273 The NodeSource Node.js Linux distributions GitHub repository contains 19 0.273 information about which versions of Node.js and which Linux distributions 19 0.273 are supported and how to install it. 19 0.273 https://github.com/~/distributions 19 0.273 19 0.273 19 0.273 SCRIPT DEPRECATION WARNING 19 0.273 19 0.273 ================================================================================ 19 0.273 ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 19 0.273 ================================================================================ 19 0.273 19 0.273 TO AVOID THIS WAIT MIGRATE THE SCRIPT 19 0.273 Continuing in 60 seconds (press Ctrl-C to abort) ...
1 parent 283dd02 commit 740ed15

2 files changed

Lines changed: 18 additions & 14 deletions

File tree

Dockerfile.php7

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,20 @@ RUN apt-get update \
3232
unzip \
3333
vim \
3434
zip \
35+
ca-certificates \
36+
gnupg \
3537
&& apt-get autoremove \
3638
&& apt-get clean \
3739
&& rm -rf /var/lib/apt/lists/*
3840

3941

40-
RUN curl https://deb.nodesource.com/setup_18.x -o install_node.sh \
41-
&& chmod +x install_node.sh \
42-
&& ./install_node.sh \
43-
&& apt install -y nodejs make \
44-
&& apt-get autoremove \
45-
&& apt-get clean \
46-
&& rm -rf /var/lib/apt/lists/*
42+
# Based on nodesource installation instructions https://github.com/nodesource/distributions#installation-instructions
43+
RUN mkdir -p /etc/apt/keyrings \
44+
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
45+
| gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
46+
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \
47+
&& apt-get update \
48+
&& apt-get install nodejs -y
4749

4850
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg \
4951
| gpg --dearmor >> /usr/share/keyrings/yarnkey.gpg \

Dockerfile.php8

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,20 @@ RUN apt-get update \
3232
unzip \
3333
vim \
3434
zip \
35+
ca-certificates \
36+
gnupg \
3537
&& apt-get autoremove \
3638
&& apt-get clean \
3739
&& rm -rf /var/lib/apt/lists/*
3840

3941

40-
RUN curl https://deb.nodesource.com/setup_18.x -o install_node.sh \
41-
&& chmod +x install_node.sh \
42-
&& ./install_node.sh \
43-
&& apt install -y nodejs make \
44-
&& apt-get autoremove \
45-
&& apt-get clean \
46-
&& rm -rf /var/lib/apt/lists/*
42+
# Based on nodesource installation instructions https://github.com/nodesource/distributions#installation-instructions
43+
RUN mkdir -p /etc/apt/keyrings \
44+
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
45+
| gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
46+
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \
47+
&& apt-get update \
48+
&& apt-get install nodejs -y
4749

4850
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg \
4951
| gpg --dearmor >> /usr/share/keyrings/yarnkey.gpg \

0 commit comments

Comments
 (0)