PHP with graphic libraries

This commit is contained in:
Deon George 2021-07-06 16:08:35 +10:00
parent 972a4aeaf8
commit 03f83bc304
3 changed files with 39 additions and 25 deletions

View File

@ -1,11 +1,11 @@
image: docker:latest
stages:
- test
- build
- build-test
variables:
BRANCH: plus
BRANCH: image
VERSION: 8.0-fpm-${BRANCH}
CACHETAG: build-${BRANCH}
DOCKER_HOST: tcp://docker:2375
@ -18,16 +18,6 @@ before_script:
- docker version
- echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin
test:
stage: test
script:
- cat /etc/hosts
- env|sort
- docker build -t ${CI_REGISTRY_IMAGE}:${VERSION} .
- docker images
only:
- debug
x86_64:build:
stage: build
script:
@ -36,9 +26,21 @@ x86_64:build:
- docker build --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION} -t ${CI_REGISTRY_IMAGE}:${CACHETAG} .
- docker push ${CI_REGISTRY_IMAGE}:${VERSION}
- docker push ${CI_REGISTRY_IMAGE}:${CACHETAG}
- apk add curl && curl -LX POST --post301 -F token=${TRIGGER_TOKEN} -F ref=ext ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/trigger/pipeline
tags:
- docker
- x86_64
only:
- plus
- image
x86_64:build-test:
stage: build-test
script:
- if [ -f init ]; then chmod 500 init; fi
- ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || true
- docker build --file Dockerfile.phptest --cache-from ${CI_REGISTRY_IMAGE}:${CACHETAG} -t ${CI_REGISTRY_IMAGE}:${VERSION}-test .
- docker push ${CI_REGISTRY_IMAGE}:${VERSION}-test
tags:
- docker
- x86_64
only:
- image

View File

@ -1,7 +1,15 @@
# NAME leenooks/php
# VERSION 8.0-fpm-plus
# VERSION 8.0-fpm-image
FROM registry.leenooks.net/leenooks/php:8.0-fpm-mp
FROM registry.leenooks.net/leenooks/php:8.0-fpm-latest
RUN mv /sbin/init /sbin/init.tmp \
&& apt-get update \
&& apt-get install -yqq wkhtmltopdf \
&& apt purge -yqq systemd-sysv dconf-service \
&& apt autoremove -yqq \
&& rm -rf /var/lib/apt/lists/* /tmp/* \
&& mv /sbin/init.tmp /sbin/init
RUN cd /usr/local/bin && curl -OsL https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions && chmod +x install-php-extensions
@ -33,8 +41,7 @@ RUN mv /sbin/init /sbin/init.tmp \
&& make install \
&& ldconfig \
&& apt-get install -y libbz2-dev libgmp-dev libpng-dev libjpeg-dev libfreetype6-dev --no-install-recommends \
&& docker-php-ext-configure gd --with-freetype=/usr/include/freetype2 --with-jpeg=/usr/include/ \
&& docker-php-ext-install -j$(nproc) bz2 sockets gmp gd pcntl exif \
&& docker-php-ext-install -j$(nproc) gmp exif \
&& install-php-extensions imagick \
&& apt-get purge -y build-essential libtool wget libbz2-dev libgmp-dev libpng-dev libjpeg-dev libfreetype6-dev \
hicolor-icon-theme texlive-base texlive-binaries libx11-dev automake autotools-dev bsdmainutils dbus-user-session dbus-user-session doxygen \
@ -48,10 +55,3 @@ RUN mv /sbin/init /sbin/init.tmp \
&& rm -rf /var/lib/apt/lists/* /tmp/* \
&& rm -rf /usr/src/libde265 /usr/src/libheif /usr/src/ImageMagick \
&& mv /sbin/init.tmp /sbin/init
RUN apt-get -y update \
&& apt-get -y install build-essential libzip4 libzip-dev zlib1g-dev \
&& docker-php-ext-install -j$(nproc) zip \
&& apt-get purge -y build-essential libzip-dev zlib1g-dev \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* /tmp/*

12
Dockerfile.phptest Normal file
View File

@ -0,0 +1,12 @@
# NAME leenooks/php
# VERSION 8.0-fpm-test
FROM registry.leenooks.net/leenooks/php:8.0-fpm-latest
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug
RUN apt-get update && apt-get install -y npm \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*