1
+ ARG NODE_MAJOR=20
2
+
1
3
# Aliasing base images, so we can change just this, when needing to upgrade or pull base layers
2
4
FROM ubuntu:22.04 AS base-distro
3
5
FROM composer:2.6.6 AS composer
4
6
5
-
6
7
FROM base-distro AS install-markdownlint
8
+ ARG NODE_MAJOR
9
+ ENV NODE_MAJOR=$NODE_MAJOR
7
10
8
11
# Install system dependencies first - these don't change much
9
- RUN export DEBIAN_FRONTEND=noninteractive \
10
- && (curl -ssL https://deb.nodesource.com/setup_20.x | bash -) \
12
+ RUN set -eux; \
13
+ export DEBIAN_FRONTEND=noninteractive \
14
+ && apt update \
15
+ && apt install -y --no-install-recommends \
16
+ ca-certificates \
17
+ curl \
18
+ gnupg \
19
+ && mkdir -p /etc/apt/keyrings \
20
+ && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
21
+ && 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 \
11
22
&& apt update \
12
23
&& apt install -y --no-install-recommends \
13
- npm \
24
+ nodejs \
14
25
&& apt clean
15
26
16
27
COPY setup/markdownlint/package.json \
@@ -30,32 +41,39 @@ RUN cd /markdownlint \
30
41
31
42
32
43
FROM base-distro
33
-
44
+ ARG NODE_MAJOR
34
45
LABEL "repository" ="http://github.com/laminas/laminas-continuous-integration-action"
35
46
LABEL "homepage" ="http://github.com/laminas/laminas-continuous-integration-action"
36
47
LABEL "maintainer" ="https://github.com/laminas/technical-steering-committee/"
37
48
38
49
ENV COMPOSER_HOME=/usr/local/share/composer \
39
50
DEBIAN_FRONTEND=noninteractive \
40
- ACCEPT_EULA=Y
51
+ ACCEPT_EULA=Y \
52
+ NODE_MAJOR=$NODE_MAJOR
41
53
42
54
# This may look a bit long, but it's just a big `apt install` section, followed by a cleanup,
43
55
# so that we get a single compact layer, with not too many layer overwrites.
44
- RUN export OS_VERSION=$(cat /etc/os-release | grep VERSION_ID | cut -d '"' -f2) \
56
+ RUN set -eux; \
57
+ export OS_VERSION=$(cat /etc/os-release | grep VERSION_ID | cut -d '"' -f2) \
45
58
&& apt update \
46
59
&& apt upgrade -y \
47
60
&& apt install -y --no-install-recommends \
48
61
curl \
49
62
gpg-agent \
50
63
software-properties-common \
64
+ ca-certificates \
65
+ gnupg \
51
66
&& (curl -sSL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/microsoft.gpg) \
52
67
&& add-apt-repository -y ppa:ondrej/php \
53
68
&& 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 -) \
69
+ && mkdir -p /etc/apt/keyrings \
70
+ && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
71
+ && 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 \
55
72
&& apt update \
56
73
&& apt install -y --no-install-recommends \
57
74
# Base dependencies
58
75
git \
76
+ nodejs \
59
77
jq \
60
78
libxml2-utils \
61
79
libzip-dev \
@@ -274,7 +292,8 @@ COPY composer.json \
274
292
/tools/
275
293
276
294
# Set default PHP version based on the `composer.json` `config.platform.php` setting
277
- RUN export DEFAULT_PHP_VERSION=$(jq -r '.config.platform.php | sub("(?<minor>[0-9.]).99$"; "\( .minor)")' /tools/composer.json) \
295
+ RUN set -eux; \
296
+ export DEFAULT_PHP_VERSION=$(jq -r '.config.platform.php | sub("(?<minor>[0-9.]).99$"; "\( .minor)")' /tools/composer.json) \
278
297
&& update-alternatives --set php /usr/bin/php$DEFAULT_PHP_VERSION \
279
298
&& update-alternatives --set phpize /usr/bin/phpize$DEFAULT_PHP_VERSION \
280
299
&& update-alternatives --set php-config /usr/bin/php-config$DEFAULT_PHP_VERSION \
0 commit comments