Skip to content

Commit c21c195

Browse files
committed
update node installation in Earthfile
1 parent 99d0752 commit c21c195

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Earthfile

+6-2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ devcontainer-base:
4949
# Clean up
5050
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/
5151

52+
# https://github.com/nodesource/distributions#installation-instructions
53+
RUN mkdir -p /etc/apt/keyrings && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
54+
ARG NODE_MAJOR=16
55+
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
56+
5257
# Configure apt and install packages
5358
RUN apt-get update \
5459
&& apt-get install -y --no-install-recommends apt-utils dialog 2>&1 \
@@ -70,8 +75,7 @@ devcontainer-base:
7075
php-mbstring \
7176
php-mysql \
7277
php-sqlite3 \
73-
&& curl -sL https://deb.nodesource.com/setup_16.x | bash - \
74-
&& apt-get install -y nodejs=16.* \
78+
nodejs="$NODE_MAJOR.*" \
7579
#
7680
# Clean up
7781
&& apt-get autoremove -y \

0 commit comments

Comments
 (0)