-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.unit-php-builder
29 lines (28 loc) · 1.61 KB
/
Dockerfile.unit-php-builder
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
#Codename of Debian image
ARG DEBIAN_VERSION="bookworm"
#Update date of Debian image
ARG DEBIAN_DATE="20240812"
FROM debian:$DEBIAN_VERSION-$DEBIAN_DATE-slim
#Duplicate declaration to make arg available in this scope
ARG DEBIAN_VERSION="bookworm"
#Current date to force OS packages update if needed
ARG DATE="2024-08-29"
#Add PHP repo key
ADD --chmod=644 https://packages.sury.org/php/apt.gpg /etc/apt/keyrings/php.gpg
#Add PHP repo
RUN echo "OS package update: $DATE" \
&& apt update && apt -y install apt-transport-https ca-certificates gnupg \
&& echo "deb [signed-by=/etc/apt/keyrings/php.gpg] https://packages.sury.org/php/ $DEBIAN_VERSION main" >> /etc/apt/sources.list.d/php.list \
&& echo "deb-src [signed-by=/etc/apt/keyrings/php.gpg] https://packages.sury.org/php/ $DEBIAN_VERSION main" >> /etc/apt/sources.list.d/php.list \
&& apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
#Install packages required for Unit building - variable BUILD_DEPENDS_unit from https://github.com/nginx/unit/pkg/deb/Makefile
RUN apt update && apt -y install git \
build-essential debhelper devscripts fakeroot libxml2-utils lintian lsb-release xsltproc libssl-dev clang llvm \
&& apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
#PHP version
ARG PHP="8.3"
#Install packages required for PHP module building - variables BUILD_DEPENDS_php* from https://github.com/Articus/unit-php/Makefile.php*
RUN apt update && apt -y install php${PHP}-dev libphp${PHP}-embed \
&& apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
#Setup dummy startup script
CMD php -v