From 56755bbaaa820598e338acee7dad710c850e80e7 Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 6 Jul 2021 16:11:48 +1000 Subject: [PATCH] PHP for DB2 --- .gitlab-ci.yml | 8 ++---- Dockerfile | 68 ++++++---------------------------------------- Dockerfile.phptest | 2 +- 3 files changed, 13 insertions(+), 65 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2092e41..23fbb95 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ stages: - build-test variables: - BRANCH: latest + BRANCH: db2 VERSION: 8.0-fpm-${BRANCH} CACHETAG: build-${BRANCH} DOCKER_HOST: tcp://docker:2375 @@ -26,13 +26,11 @@ 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=image ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/trigger/pipeline - - apk add curl && curl -LX POST --post301 -F token=${TRIGGER_TOKEN} -F ref=server ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/trigger/pipeline tags: - docker - x86_64 only: - - master + - db2 x86_64:build-test: stage: build-test @@ -45,4 +43,4 @@ x86_64:build-test: - docker - x86_64 only: - - master + - db2 diff --git a/Dockerfile b/Dockerfile index 8012905..34ce9ad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,66 +1,16 @@ # NAME leenooks/php -# VERSION 8.0-fpm-latest +# VERSION 8.0-fpm-db2 -FROM php:8.0-fpm +FROM registry.leenooks.net/leenooks/php:8.0-fpm-latest -RUN apt-get update && apt-get install -y openssh-server unzip git msmtp nginx wait-for-it \ - && rm /etc/nginx/sites-enabled/default \ - && apt-get -y autoremove \ +# Install DB2 +RUN apt-get update && apt-get install -y ksh \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -RUN useradd -c "Hosting Admin User" -u 1000 -g users -G www-data -d /var/www/html -M lamp -RUN sed -e 's/^expose_php = On/expose_php = Off/' /usr/local/etc/php/php.ini-production > /usr/local/etc/php/php.ini -COPY www.conf /usr/local/etc/php-fpm.d/ -COPY nginx-app.conf /etc/nginx/conf.d/ - -COPY sshd_config.patch /tmp/ -RUN (cd / && patch -p0 ) < /tmp/sshd_config.patch && rm /tmp/sshd_config.patch - -COPY msmtprc /etc/ -RUN sed -i -e 's#^;sendmail_path =#sendmail_path = "/usr/bin/msmtp -t"#' /usr/local/etc/php/php.ini && sed -i -e 's#^memory_limit = 128M#memory_limit = 256M#' /usr/local/etc/php/php.ini - -EXPOSE 22/tcp - -# Add composer -RUN curl https://getcomposer.org/installer|php -- --install-dir=/usr/local/bin --filename=composer - -# Add Mongo DB -RUN pecl install mongodb && docker-php-ext-enable mongodb \ - && rm -rf /tmp/* - -# Mysql/Postgress/LDAP -RUN apt-get update && apt-get install -y openssh-server libpq5 libpq-dev unzip git libldap2-dev \ - && docker-php-ext-install -j$(nproc) pdo_mysql pdo_pgsql ldap gettext \ - && apt-get -y purge libpq-dev libldap2-dev libx11-6 dbus ncurses-term systemd \ - && apt-get -y autoremove \ - && apt-get clean \ +RUN mkdir /opt/ibm && cd /opt/ibm \ + && curl -L https://yum.leenooks.net/docker/src/db2/v11.5.6_linuxx64_dsdriver.tar.gz | tar xzf - \ + && /opt/ibm/dsdriver/installDSDriver \ + && echo /opt/ibm/dsdriver/|pecl install ibm_db2 \ + && docker-php-ext-enable ibm_db2 \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -# Enable phpredis -RUN apt-get update && apt-get install -y redis \ - && pecl install -o -f igbinary && pecl install -o -f redis && docker-php-ext-enable redis igbinary \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -# Enable phpmemcache -RUN apt-get update && apt-get install -y memcached libmemcachedutil2 zlib1g-dev libmemcached-dev \ - && pecl install -o -f memcached && docker-php-ext-enable memcached \ - && apt-get -y purge zlib1g-dev libmemcached-dev \ - && apt-get -y autoremove \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* - -# Enable ZIP -RUN apt-get -y update \ - && apt-get -y install build-essential libzip4 libzip-dev libpng16-16 libpng-dev libbz2-dev zlib1g-dev libgmp-dev libjpeg62-turbo libjpeg-dev libfreetype6 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) zip bz2 gd \ - && apt-get purge -y build-essential libzip-dev zlib1g-dev libpng-dev libbz2-dev zlib1g-dev libgmp-dev libjpeg-dev libfreetype6-dev \ - && apt-get autoremove -y \ - && rm -rf /var/lib/apt/lists/* /tmp/* - -COPY init /sbin/ -RUN chmod 550 /sbin/init && chown 0:0 /sbin/init -ENTRYPOINT [ "/sbin/init" ] -CMD [ "php-fpm" ] diff --git a/Dockerfile.phptest b/Dockerfile.phptest index fb8181d..64d94ae 100644 --- a/Dockerfile.phptest +++ b/Dockerfile.phptest @@ -1,7 +1,7 @@ # NAME leenooks/php # VERSION 8.0-fpm-test -FROM registry.leenooks.net/leenooks/php:8.0-fpm-mp +FROM registry.leenooks.net/leenooks/php:8.0-fpm-latest RUN pecl install xdebug \ && docker-php-ext-enable xdebug