build: fix php85-ci image ofr optimized usage
This commit is contained in:
parent
022a724c3d
commit
9985ad2ca0
1 changed files with 47 additions and 5 deletions
|
|
@ -1,13 +1,16 @@
|
|||
FROM composer:2.10
|
||||
# Stage 1 : PHP build
|
||||
# composer:2.2.30 amd64
|
||||
FROM composer@sha256:49cd26cd023fce962abcce4a3f3aafa4fc5e9d618d30a7f76da498b6627a0250 AS builder
|
||||
|
||||
ARG http_proxy
|
||||
|
||||
ENV http_proxy=${http_proxy} \
|
||||
https_proxy=${http_proxy} \
|
||||
HTTP_PROXY=${http_proxy} \
|
||||
HTTPS_PROXY=${http_proxy}
|
||||
|
||||
RUN apk add --no-cache --virtual .build-deps \
|
||||
RUN apk add --no-cache \
|
||||
$PHPIZE_DEPS \
|
||||
linux-headers \
|
||||
zlib-dev \
|
||||
libpng-dev \
|
||||
libjpeg-turbo-dev \
|
||||
|
|
@ -16,10 +19,49 @@ RUN apk add --no-cache --virtual .build-deps \
|
|||
gmp-dev \
|
||||
libxslt-dev \
|
||||
gettext-dev \
|
||||
&& docker-php-ext-configure gd \
|
||||
libtool
|
||||
|
||||
RUN docker-php-ext-configure gd \
|
||||
--with-freetype \
|
||||
--with-jpeg \
|
||||
&& docker-php-ext-install -j"$(nproc)" \
|
||||
bcmath \
|
||||
exif \
|
||||
gd \
|
||||
gettext \
|
||||
gmp \
|
||||
intl \
|
||||
xsl
|
||||
|
||||
# Install pie -> pcov
|
||||
RUN apk add --no-cache git \
|
||||
&& git clone --depth 1 https://github.com/krakjoe/pcov.git /tmp/pcov \
|
||||
&& cd /tmp/pcov \
|
||||
&& phpize \
|
||||
&& ./configure \
|
||||
&& make -j"$(nproc)" \
|
||||
&& make install \
|
||||
&& rm -rf /tmp/pcov
|
||||
|
||||
# Stage 2 : Image Build
|
||||
# composer:2.2.30 amd64
|
||||
FROM composer@sha256:49cd26cd023fce962abcce4a3f3aafa4fc5e9d618d30a7f76da498b6627a0250
|
||||
|
||||
# Runtime dependencies
|
||||
RUN apk add --no-cache \
|
||||
freetype \
|
||||
libjpeg-turbo \
|
||||
libpng \
|
||||
icu-libs \
|
||||
icu-data-full \
|
||||
gmp \
|
||||
libxslt \
|
||||
libintl
|
||||
|
||||
# Install and activate extensions
|
||||
COPY --from=builder /usr/local/lib/php/extensions/ /usr/local/lib/php/extensions/
|
||||
|
||||
RUN docker-php-ext-enable \
|
||||
bcmath \
|
||||
exif \
|
||||
gd \
|
||||
|
|
@ -27,6 +69,6 @@ RUN apk add --no-cache --virtual .build-deps \
|
|||
gmp \
|
||||
intl \
|
||||
xsl \
|
||||
&& apk del .build-deps
|
||||
pcov
|
||||
|
||||
WORKDIR /project
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue