-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdebian.apache.Dockerfile
More file actions
88 lines (83 loc) · 2.88 KB
/
debian.apache.Dockerfile
File metadata and controls
88 lines (83 loc) · 2.88 KB
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
ARG PHP_VERSION=8.4
FROM tobi312/php:${PHP_VERSION}-apache-slim
ARG PHP_VERSION
ARG VCS_REF
ARG BUILD_DATE
ARG DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-euxo", "pipefail", "-c"]
LABEL org.opencontainers.image.authors="Tobias Hargesheimer <docker@ison.ws>" \
org.opencontainers.image.title="PHP+Apache2" \
org.opencontainers.image.description="Debian with PHP ${PHP_VERSION} and Apache2" \
org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.revision="${VCS_REF}" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.url="https://hub.docker.com/r/tobi312/php" \
org.opencontainers.image.source="https://github.com/Tob1as/docker-php"
# PHP
RUN \
PHP_EXTENSIONS_LIST=" \
@composer \
apcu \
bcmath \
bz2 \
calendar \
dba \
enchant \
exif \
ffi \
# gd \
gettext \
gmp \
imagick \
# imap \
intl \
ldap \
memcached \
mongodb \
mysqli \
opcache \
pdo_dblib \
pdo_mysql \
pdo_pgsql \
pgsql \
pspell \
redis \
shmop \
snmp \
tidy \
xsl \
yaml \
zip \
" \
; \
\
ARCH=`uname -m` ; \
echo "ARCH=$ARCH" ; \
if [[ "$ARCH" == "armv"* ]]; then \
# fix: /usr/lib/gcc/arm-linux-gnueabihf/10/include/arm_neon.h:10403:1: error: inlining failed in call to ‘always_inline’ ‘vld1q_u8’: target specific option mismatch
apt-get update ; \
apt-get install -y --no-install-recommends libfreetype6 libjpeg62-turbo ^libpng[0-9]+-[0-9]+$ libxpm4 ^libwebp[0-9]+$ ; \
temp_package="libfreetype6-dev libjpeg62-turbo-dev libpng-dev libxpm-dev libwebp-dev" ; \
apt-get install -y --no-install-recommends $temp_package ; \
docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype ; \
docker-php-ext-install -j$(nproc) gd ; \
apt-get purge -y $temp_package ; apt-get autoremove -y ; \
rm -rf /var/lib/apt/lists/* ; \
#php -i | grep 'GD' ; \
else \
PHP_EXTENSIONS_LIST="$PHP_EXTENSIONS_LIST gd imap" ; \
fi ; \
# bugfix/workarround: https://packages.debian.org/search?suite=default§ion=all&arch=any&searchon=names&keywords=libmemcachedutil2
DISTRO="$(cat /etc/os-release | grep -E ^ID= | cut -d = -f 2)" ; \
DISTRO_VERSION_NUMBER="$(cat /etc/os-release | grep -E ^VERSION_ID= | cut -d = -f 2 | cut -d '"' -f 2 | cut -d . -f 1,2)" ; \
if [ "$DISTRO" = "debian" ] && [ "$DISTRO_VERSION_NUMBER" -ge 13 ]; then \
if grep -q 'libmemcachedutil2' /usr/local/bin/install-php-extensions && \
! grep -q 'libmemcachedutil2t64' /usr/local/bin/install-php-extensions; then \
echo ">> Applying libmemcachedutil2 → libmemcachedutil2t64 workaround"; \
sed -i 's/libmemcachedutil2/libmemcachedutil2t64/g' /usr/local/bin/install-php-extensions; \
else \
echo ">> Workaround not needed (already fixed upstream)"; \
fi; \
fi; \
install-php-extensions $PHP_EXTENSIONS_LIST ; \
php -m