-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
269 lines (240 loc) · 7.75 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# Aliasing base images, so we can change just this, when needing to upgrade or pull base layers
FROM ubuntu:22.04 AS base-distro
FROM composer:2.4.4 AS composer
FROM base-distro AS install-markdownlint
# Install system dependencies first - these don't change much
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt update \
&& apt install -y --no-install-recommends \
npm \
&& apt clean
COPY setup/markdownlint/package.json \
setup/markdownlint/package-lock.json \
setup/markdownlint/markdownlint.json \
/markdownlint/
COPY setup/markdownlint/dummy-ok-markdown-test-file.md \
setup/markdownlint/dummy-ko-markdown-test-file.md \
/test-files/
RUN cd /markdownlint \
&& npm ci \
# Smoke-testing the installation, just making sure it works as expected - should pass first file, fail on second
&& node_modules/.bin/markdownlint-cli2 /test-files/dummy-ok-markdown-test-file.md \
&& if node_modules/.bin/markdownlint-cli2 /test-files/dummy-ko-markdown-test-file.md; then exit 1; else exit 0; fi
FROM composer AS staabm-annotate-pull-request-from-checkstyle
COPY setup/staabm-annotate-pull-request-from-checkstyle/composer.json \
setup/staabm-annotate-pull-request-from-checkstyle/composer.lock \
/staabm-annotate-pull-request-from-checkstyle/
RUN cd /staabm-annotate-pull-request-from-checkstyle \
&& composer install \
--no-dev \
--classmap-authoritative
FROM base-distro
LABEL "repository"="http://github.com/laminas/laminas-continuous-integration-action"
LABEL "homepage"="http://github.com/laminas/laminas-continuous-integration-action"
LABEL "maintainer"="https://github.com/laminas/technical-steering-committee/"
ENV COMPOSER_HOME=/usr/local/share/composer \
DEBIAN_FRONTEND=noninteractive \
ACCEPT_EULA=Y
# This may look a bit long, but it's just a big `apt install` section, followed by a cleanup,
# so that we get a single compact layer, with not too many layer overwrites.
RUN apt update \
&& apt upgrade -y \
&& apt install -y --no-install-recommends \
curl \
gpg-agent \
software-properties-common \
&& (curl -sSL https://packages.microsoft.com/keys/microsoft.asc | apt-key add -) \
&& add-apt-repository -y ppa:ondrej/php \
&& add-apt-repository -y https://packages.microsoft.com/ubuntu/22.04/prod \
&& apt install -y --no-install-recommends \
# Base dependencies
git \
jq \
libxml2-utils \
libzip-dev \
make \
nodejs \
sudo \
wget \
yamllint \
zip \
unzip \
msodbcsql17 \
\
php-pear \
\
php5.6-bz2 \
php5.6-cli \
php5.6-curl \
php5.6-dev \
php5.6-fileinfo \
php5.6-intl \
php5.6-json \
php5.6-mbstring \
php5.6-phar \
php5.6-phpdbg \
php5.6-readline \
php5.6-sockets \
php5.6-xml \
php5.6-xsl \
php5.6-zip \
\
php7.0-cli \
php7.0-bz2 \
php7.0-curl \
php7.0-dev \
php7.0-fileinfo \
php7.0-intl \
php7.0-json \
php7.0-mbstring \
php7.0-phar \
php7.0-phpdbg \
php7.0-readline \
php7.0-sockets \
php7.0-xml \
php7.0-xsl \
php7.0-zip \
\
php7.1-cli \
php7.1-bz2 \
php7.1-curl \
php7.1-dev \
php7.1-fileinfo \
php7.1-intl \
php7.1-json \
php7.1-mbstring \
php7.1-phar \
php7.1-phpdbg \
php7.1-readline \
php7.1-sockets \
php7.1-xml \
php7.1-xsl \
php7.1-zip \
\
php7.2-cli \
php7.2-bz2 \
php7.2-curl \
php7.2-dev \
php7.2-fileinfo \
php7.2-intl \
php7.2-json \
php7.2-mbstring \
php7.2-phar \
php7.2-phpdbg \
php7.2-readline \
php7.2-sockets \
php7.2-xml \
php7.2-xsl \
php7.2-zip \
\
php7.3-cli \
php7.3-bz2 \
php7.3-curl \
php7.3-dev \
php7.3-fileinfo \
php7.3-intl \
php7.3-json \
php7.3-mbstring \
php7.3-phar \
php7.3-phpdbg \
php7.3-readline \
php7.3-sockets \
php7.3-xml \
php7.3-xsl \
php7.3-zip \
\
php7.4-cli \
php7.4-bz2 \
php7.4-curl \
php7.4-dev \
php7.4-fileinfo \
php7.4-intl \
php7.4-json \
php7.4-mbstring \
php7.4-phar \
php7.4-phpdbg \
php7.4-readline \
php7.4-sockets \
php7.4-xml \
php7.4-xsl \
php7.4-zip \
\
php8.0-cli \
php8.0-bz2 \
php8.0-curl \
php8.0-dev \
php8.0-fileinfo \
php8.0-intl \
php8.0-mbstring \
php8.0-phar \
php8.0-phpdbg \
php8.0-readline \
php8.0-sockets \
php8.0-xml \
php8.0-xsl \
php8.0-zip \
\
php8.1-cli \
php8.1-bz2 \
php8.1-curl \
php8.1-dev \
php8.1-fileinfo \
php8.1-intl \
php8.1-mbstring \
php8.1-phar \
php8.1-phpdbg \
php8.1-readline \
php8.1-sockets \
php8.1-xml \
php8.1-xsl \
php8.1-zip \
\
php8.2-cli \
php8.2-bz2 \
php8.2-curl \
php8.2-dev \
php8.2-fileinfo \
php8.2-intl \
php8.2-mbstring \
php8.2-phar \
php8.2-phpdbg \
php8.2-readline \
php8.2-sockets \
php8.2-xml \
php8.2-xsl \
php8.2-zip \
# Set default PHP version
&& update-alternatives --set php /usr/bin/php8.0 \
&& update-alternatives --set phpize /usr/bin/phpize8.0 \
&& update-alternatives --set php-config /usr/bin/php-config8.0 \
&& apt autoremove -y \
&& apt clean
# Build/install static modules that do not have packages
COPY mods-available /mods-available
COPY mods-install /mods-install
RUN set -e; for INSTALLER in /mods-install/*.sh; do ${INSTALLER} ; done
COPY scripts /scripts
RUN chmod a+x /scripts/*
RUN /scripts/php_ini_dev_settings.sh
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
COPY php-extensions-with-version.php /usr/local/bin/php-extensions-with-version.php
RUN chmod +x /usr/local/bin/php-extensions-with-version.php
# Copy Markdownlint installation to this stage
COPY --from=install-markdownlint /markdownlint /markdownlint
RUN ln -s /markdownlint/node_modules/.bin/markdownlint-cli2 /usr/local/bin/markdownlint
COPY --from=install-markdownlint /markdownlint/markdownlint.json /etc/laminas-ci/markdownlint.json
# Copy staabm/annotate-pull-request-from-checkstyle to this stage
COPY --from=staabm-annotate-pull-request-from-checkstyle /staabm-annotate-pull-request-from-checkstyle /staabm-annotate-pull-request-from-checkstyle
RUN ln -s /staabm-annotate-pull-request-from-checkstyle/vendor/bin/cs2pr /usr/local/bin/cs2pr
# Add composer binary to the image
COPY --from=composer /usr/bin/composer /usr/bin/composer
# We use https://github.com/xt0rted/markdownlint-problem-matcher/blob/caf6b376527f8a8ac3b8ed6746989e51a6e560c8/.github/problem-matcher.json
# and https://github.com/shivammathur/setup-php/blob/57db6baebbe30a3126c7a03aa0e3267fa7872d96/src/configs/pm/phpunit.json
# to match the output of Markdownlint and PHPUnit to GitHub Actions
# annotations (https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-warning-message)
COPY setup/markdownlint/problem-matcher.json /etc/laminas-ci/problem-matcher/markdownlint.json
COPY setup/phpunit/problem-matcher.json /etc/laminas-ci/problem-matcher/phpunit.json
RUN useradd -ms /bin/bash testuser
# Copy ubuntu setup
COPY setup/ubuntu /
ENTRYPOINT ["entrypoint.sh"]