1
1
ARG DOCKER_HUB_PROXY=""
2
2
3
3
4
- FROM "${DOCKER_HUB_PROXY}python:3.12-slim-bookworm " as php-base
4
+ FROM "${DOCKER_HUB_PROXY}ubuntu:24.04 " as php-base
5
5
ENV DEBIAN_FRONTEND noninteractive
6
+ ENV LC_ALL C.UTF-8
6
7
7
8
# Uncomment when building in corporate environments
8
9
# COPY ./rootca.crt /usr/local/share/ca-certificates/rootca.pem
9
10
# COPY ./rootca.crt /usr/lib/ssl/cert.pem
10
11
11
- RUN apt-get update; apt-get install -y --no-install-recommends \
12
- lsb-release \
12
+ RUN apt-get update; apt-get upgrade; apt-get install -y --no-install-recommends \
13
13
ca-certificates \
14
- curl
15
- RUN curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
16
- RUN dpkg -i /tmp/debsuryorg-archive-keyring.deb
17
- RUN echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
14
+ && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
15
+
16
+ COPY files/etc/apt/sources.list.d/ondrej-ubuntu-php-noble.sources /etc/apt/sources.list.d/ondrej-ubuntu-php-noble.sources
17
+ COPY files/etc/apt/sources.list.d/ondrej-ubuntu-nginx-mainline-noble.sources /etc/apt/sources.list.d/ondrej-ubuntu-nginx-mainline-noble.sources
18
+
19
+ # RUN apt-get update; apt-get install -y --no-install-recommends \
20
+ # software-properties-common
21
+ # # && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
22
+ # RUN add-apt-repository ppa:ondrej/php
23
+ # RUN add-apt-repository ppa:ondrej/nginx-mainline
18
24
RUN apt-get update
19
25
20
26
21
27
FROM php-base as composer-build
22
28
ENV DEBIAN_FRONTEND noninteractive
23
29
ENV COMPOSER_ALLOW_SUPERUSER 1
30
+ ENV COMPOSER_IPRESOLVE 4
24
31
ARG CORE_TAG
25
32
ARG CORE_COMMIT
26
33
27
- RUN apt-get install -y --no-install-recommends \
34
+ RUN apt-get update; apt-get install -y --no-install-recommends \
35
+ ca-certificates \
28
36
php7.4 \
29
37
php7.4-apcu \
30
38
php7.4-curl \
@@ -43,9 +51,16 @@ FROM php-base as composer-build
43
51
WORKDIR /tmp
44
52
ADD https://raw.githubusercontent.com/MISP/MISP/${CORE_COMMIT:-${CORE_TAG}}/app/composer.json /tmp
45
53
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
46
- RUN composer config --no-interaction allow-plugins.composer/installers true
47
- RUN composer install
48
- RUN composer require --with-all-dependencies --no-interaction \
54
+
55
+ RUN cp /usr/bin/composer /composer.phar
56
+ RUN mkdir /out/
57
+ RUN php -r '$phar = new Phar("/composer.phar"); $phar->extractTo("/out/");'
58
+
59
+ COPY files/CurlDownloader.php /out/src/Composer/Util/Http/CurlDownloader.php
60
+ RUN php /out/bin/composer config --no-interaction allow-plugins.composer/installers true
61
+ RUN php /out/bin/composer config --no-interaction secure-http false
62
+ RUN php /out/bin/composer install
63
+ RUN php /out/bin/composer require --with-all-dependencies --no-interaction \
49
64
supervisorphp/supervisor:^4.0 \
50
65
guzzlehttp/guzzle \
51
66
lstrojny/fxmlrpc \
@@ -76,8 +91,6 @@ FROM php-base as php-build
76
91
php-pear \
77
92
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
78
93
79
- RUN apt-cache search pecl
80
-
81
94
RUN update-alternatives --set php /usr/bin/php7.4
82
95
RUN update-alternatives --set php-config /usr/bin/php-config7.4
83
96
RUN update-alternatives --set phpize /usr/bin/phpize7.4
@@ -108,6 +121,7 @@ FROM php-base as python-build
108
121
109
122
RUN apt-get install -y --no-install-recommends \
110
123
git \
124
+ python3-pip \
111
125
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*
112
126
113
127
# Download MISP using git in the /var/www/ directory. Remove unnecessary items.
@@ -180,6 +194,7 @@ FROM php-base
180
194
gpg-agent \
181
195
mariadb-client \
182
196
rsync \
197
+ python3-pip \
183
198
# PHP Requirements
184
199
php7.4 \
185
200
php7.4-apcu \
@@ -198,7 +213,7 @@ FROM php-base
198
213
libldap-common \
199
214
librdkafka1 \
200
215
libbrotli1 \
201
- libsimdjson14 \
216
+ libsimdjson19 \
202
217
libzstd1 \
203
218
ssdeep \
204
219
libfuzzy2 \
@@ -212,7 +227,7 @@ FROM php-base
212
227
213
228
# Install python modules
214
229
COPY --from=python-build /wheels /wheels
215
- RUN pip install --no-cache-dir /wheels/*.whl && rm -rf /wheels
230
+ RUN pip install --break-system-packages -- no-cache-dir /wheels/*.whl && rm -rf /wheels
216
231
217
232
# PHP: install prebuilt libraries, then install the app's PHP deps
218
233
COPY --from=php-build ["/usr/lib/php/${PHP_VER}/ssdeep.so" , "/usr/lib/php/${PHP_VER}/rdkafka.so" , "/usr/lib/php/${PHP_VER}/brotli.so" , "/usr/lib/php/${PHP_VER}/simdjson.so" , "/usr/lib/php/${PHP_VER}/zstd.so" , "/usr/lib/php/${PHP_VER}/" ]
0 commit comments