-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile.base
47 lines (44 loc) · 1.88 KB
/
Dockerfile.base
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
ENV PHP_JPEG_DIR="/usr" \
PHP_PNG_DIR="/usr" \
PHP_ZLIB_DIR="/usr" \
PHP_WEBP_DIR="/usr" \
PHP_INI_SCAN_DIR="/usr/local/etc/php/conf.d/:/usr/local/etc/php/conf-override.d/" \
# fixes iconv
LD_PRELOAD="/usr/lib/preloadable_libiconv.so"
RUN apk add --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/community gnu-libiconv
RUN apk update \
&& apk upgrade \
&& apk add --no-cache $RUN_DEPS \
&& apk add -t .build-deps $BUILD_DEPS \
&& if [ -z "$(echo "$PHP_EXTS" |sed '/^gd\| gd/d')" ]; then \
if [ "${PHP_VERSION%.*}" == "7.4" -o "${PHP_VERSION%.*}" == "8.0" -o "${PHP_VERSION%.*}" == "8.1" ]; then \
docker-php-ext-configure gd --enable-gd \
--with-webp \
--with-jpeg \
--with-xpm \
--with-freetype \
--enable-gd-jis-conv \
; fi && \
if [ "${PHP_VERSION%.*}" == "7.3" -o "${PHP_VERSION%.*}" == "7.2" ]; then \
docker-php-ext-configure gd \
--with-freetype-dir=/usr \
--with-jpeg-dir=/usr \
--with-webp-dir=/usr \
--with-zlib-dir=/usr \
--with-png-dir=/usr \
--with-xpm-dir=/usr \
--enable-gd-jis-conv \
; fi \
; fi \
&& docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) $PHP_EXTS \
&& docker-php-ext-enable --ini-name 05-opcache.ini opcache \
&& pecl channel-update pecl.php.net \
&& pecl install -o -f $PECL_EXTS \
&& docker-php-ext-enable $PECL_EXTS \
&& cp "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
&& pecl clear-cache \
&& apk del .build-deps \
# Clear
&& rm -rf /tmp/* /var/cache/apk/*
COPY --from=composer:1 /usr/bin/composer /usr/bin/composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer2