-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
56 lines (48 loc) · 1.62 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
FROM php:8.0.30-fpm-alpine
# opcache
RUN set -eux; \
docker-php-ext-install opcache
# mysqli (deprecated)
RUN set -eux; \
docker-php-ext-install mysqli
# gd
RUN set -eux; \
apk add --no-cache freetype libjpeg-turbo libpng; \
apk add --no-cache --virtual .deps freetype-dev libjpeg-turbo-dev libpng-dev; \
docker-php-ext-configure gd \
--with-freetype=/usr/include/ \
--with-jpeg=/usr/include/; \
docker-php-ext-install gd; \
docker-php-source delete; \
apk del .deps
# PDO: mysql driver
RUN set -eux; \
docker-php-ext-install pdo pdo_mysql
# PDO: pgsql driver
# See: https://github.com/docker-library/php/issues/221
RUN set -eux; \
apk add --no-cache postgresql-libs; \
apk add --no-cache --virtual .deps postgresql-dev; \
docker-php-ext-install pdo_pgsql; \
apk del .deps
# memcached
# See: https://stackoverflow.com/questions/40894385/how-can-i-install-the-php-memcached-extension-on-dockers-php7-alpine-image
RUN set -eux; \
apk add --no-cache libmemcached-libs zlib; \
apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS; \
apk add --no-cache --virtual .deps zlib-dev libmemcached-dev cyrus-sasl-dev; \
pecl install memcached; \
echo "extension=memcached.so" > /usr/local/etc/php/conf.d/20_memcached.ini; \
docker-php-source delete; \
apk del .deps; \
apk del .phpize-deps;
# Sockets
# See: https://github.com/docker-library/php/issues/181#issuecomment-173365852
RUN set -eux; \
apk add --no-cache --virtual .deps linux-headers; \
docker-php-ext-install sockets; \
apk del .deps
RUN set -eux; \
echo; \
php -i; \
php -m