Skip to content

Commit 48653a4

Browse files
authored
Merge pull request #6 from mhitza/fix-install-missing-npm
fix: install npm in docker containers
2 parents 24107f5 + fff6020 commit 48653a4

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

Dockerfile.php7

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@ RUN apt-get update \
3939
&& rm -rf /var/lib/apt/lists/*
4040

4141

42+
ENV NODE_MAJOR=20
4243
# Based on nodesource installation instructions https://github.com/nodesource/distributions#installation-instructions
4344
RUN mkdir -p /etc/apt/keyrings \
4445
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
4546
| 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+
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \
4748
&& apt-get update \
4849
&& apt-get install nodejs -y
4950

Dockerfile.php8

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@ RUN apt-get update \
3939
&& rm -rf /var/lib/apt/lists/*
4040

4141

42+
ENV NODE_MAJOR=20
4243
# Based on nodesource installation instructions https://github.com/nodesource/distributions#installation-instructions
4344
RUN mkdir -p /etc/apt/keyrings \
4445
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
4546
| 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+
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \
4748
&& apt-get update \
4849
&& apt-get install nodejs -y
4950

0 commit comments

Comments
 (0)