Skip to content

Commit 7990ab5

Browse files
committed
qa: migrate nodejs installation to recommended by nodesource
See also https://github.com/nodesource/distributions#installation-instructions Signed-off-by: Maximilian Bösing <[email protected]>
1 parent 10a0ecd commit 7990ab5

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

Dockerfile

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
1+
ARG NODE_MAJOR=20
2+
13
# Aliasing base images, so we can change just this, when needing to upgrade or pull base layers
24
FROM ubuntu:22.04 AS base-distro
35
FROM composer:2.4.4 AS composer
46

5-
67
FROM base-distro AS install-markdownlint
8+
ARG NODE_MAJOR
9+
ENV NODE_MAJOR=$NODE_MAJOR
710

811
# Install system dependencies first - these don't change much
912
RUN export DEBIAN_FRONTEND=noninteractive \
10-
&& (curl -ssL https://deb.nodesource.com/setup_20.x | bash -) \
1113
&& apt update \
1214
&& apt install -y --no-install-recommends \
13-
npm \
15+
ca-certificates \
16+
curl \
17+
gnupg \
18+
&& mkdir -p /etc/apt/keyrings \
19+
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
20+
&& 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 \
21+
&& apt update \
22+
&& apt install -y --no-install-recommends \
23+
nodejs \
1424
&& apt clean
1525

1626
COPY setup/markdownlint/package.json \
@@ -30,14 +40,15 @@ RUN cd /markdownlint \
3040

3141

3242
FROM base-distro
33-
43+
ARG NODE_MAJOR
3444
LABEL "repository"="http://github.com/laminas/laminas-continuous-integration-action"
3545
LABEL "homepage"="http://github.com/laminas/laminas-continuous-integration-action"
3646
LABEL "maintainer"="https://github.com/laminas/technical-steering-committee/"
3747

3848
ENV COMPOSER_HOME=/usr/local/share/composer \
3949
DEBIAN_FRONTEND=noninteractive \
40-
ACCEPT_EULA=Y
50+
ACCEPT_EULA=Y \
51+
NODE_MAJOR=$NODE_MAJOR
4152

4253
# This may look a bit long, but it's just a big `apt install` section, followed by a cleanup,
4354
# so that we get a single compact layer, with not too many layer overwrites.
@@ -48,14 +59,19 @@ RUN export OS_VERSION=$(cat /etc/os-release | grep VERSION_ID | cut -d '"' -f2)
4859
curl \
4960
gpg-agent \
5061
software-properties-common \
62+
ca-certificates \
63+
gnupg \
5164
&& (curl -sSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/microsoft.gpg) \
5265
&& add-apt-repository -y ppa:ondrej/php \
5366
&& curl -sSL https://packages.microsoft.com/config/ubuntu/$OS_VERSION/prod.list | tee /etc/apt/sources.list.d/microsoft.list \
54-
&& (curl -ssL https://deb.nodesource.com/setup_20.x | bash -) \
67+
&& mkdir -p /etc/apt/keyrings \
68+
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
69+
&& 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 \
5570
&& apt update \
5671
&& apt install -y --no-install-recommends \
5772
# Base dependencies
5873
git \
74+
nodejs \
5975
jq \
6076
libxml2-utils \
6177
libzip-dev \

0 commit comments

Comments
 (0)