Compare commits
24 Commits
3b17ab1549
...
923b4e72ca
Author | SHA1 | Date | |
---|---|---|---|
|
923b4e72ca | ||
|
7652408e48 | ||
|
6ab3e69d83 | ||
|
20d1800ca1 | ||
|
c03dd2aaa0 | ||
|
d2518f710c | ||
|
03f83bc304 | ||
|
972a4aeaf8 | ||
|
6cd2f36bbc | ||
|
7869fc6f50 | ||
|
88c1064ebd | ||
|
ab12261b81 | ||
|
ec8accdf4a | ||
|
8f38abdaa5 | ||
|
99dbe0d13d | ||
|
a20a865d55 | ||
|
34d0a7416c | ||
|
bc3a465c0f | ||
|
cd409b2002 | ||
|
b29603092e | ||
|
68c1281162 | ||
|
921575772f | ||
|
5bf33b84ee | ||
|
99791da0ec |
@ -1,42 +1,46 @@
|
||||
image: docker:latest
|
||||
|
||||
stages:
|
||||
- test
|
||||
- build
|
||||
- build-test
|
||||
|
||||
variables:
|
||||
BRANCH: plus
|
||||
VERSION: 7.1-fpm-${BRANCH}
|
||||
BRANCH: image
|
||||
VERSION: 8.1-fpm-${BRANCH}
|
||||
CACHETAG: build-${BRANCH}
|
||||
DOCKER_REGISTRY: registry.leenooks.net
|
||||
DOCKER_HOST: tcp://${DOCKER_REGISTRY}-leenooks-ci-docker:2375
|
||||
DOCKER_HOST: tcp://docker:2375
|
||||
|
||||
services:
|
||||
- ${DOCKER_REGISTRY}/leenooks/ci-docker:dind
|
||||
- docker:dind
|
||||
|
||||
before_script:
|
||||
- docker info
|
||||
- docker version
|
||||
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN ${DOCKER_REGISTRY}
|
||||
- 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
|
||||
|
||||
build:
|
||||
x86_64:build:
|
||||
stage: build
|
||||
script:
|
||||
- docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG} || true
|
||||
- if [ -f init ]; then chmod 500 init; fi
|
||||
- ([ -z "$REFRESH" ] && docker pull ${CI_REGISTRY_IMAGE}:${CACHETAG}) || true
|
||||
- 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}
|
||||
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
|
||||
|
69
Dockerfile
69
Dockerfile
@ -1,23 +1,56 @@
|
||||
# NAME leenooks/php
|
||||
# VERSION 7.1-fpm-plus
|
||||
# VERSION 8.1-fpm-image
|
||||
|
||||
FROM php:7.1-fpm
|
||||
RUN echo "deb http://deb.debian.org/debian jessie non-free" >> /etc/apt/sources.list.d/non-free.list && apt-get update \
|
||||
&& apt-get install -y pkg-config libbz2-dev libgmp-dev libpng-dev libjpeg-dev libfreetype6-dev libsnmp-dev snmp-mibs-downloader libmagickwand-dev --no-install-recommends \
|
||||
&& download-mibs \
|
||||
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/freetype2 --with-jpeg-dir=/usr/include/ \
|
||||
&& docker-php-ext-install -j$(nproc) pdo_mysql bz2 gettext sockets gmp gd pcntl snmp exif \
|
||||
&& pecl install imagick && docker-php-ext-enable imagick \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/*
|
||||
FROM registry.leenooks.net/leenooks/php:8.1-fpm-latest
|
||||
|
||||
RUN apt-get update && apt-get install -y openssh-server && rm -rf /var/lib/apt/lists/* \
|
||||
&& useradd -c "Hosting Admin User" -u 1000 -g users -G www-data -d /var/www/html -M lamp
|
||||
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
|
||||
|
||||
EXPOSE 9000/tcp 22/tcp
|
||||
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
|
||||
|
||||
COPY sshd_config.patch /tmp
|
||||
RUN (cd / && patch -p0 ) < /tmp/sshd_config.patch && rm /tmp/sshd_config.patch
|
||||
|
||||
COPY start /usr/local/sbin
|
||||
ENTRYPOINT [ "/usr/local/sbin/start" ]
|
||||
CMD ["php-fpm"]
|
||||
RUN mv /sbin/init /sbin/init.tmp \
|
||||
&& sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list \
|
||||
&& cat /etc/apt/sources.list|grep ^deb | sed -E 's/^deb/deb-src/' >> /etc/apt/sources.list \
|
||||
&& apt-get -y update \
|
||||
&& apt-get -y install wget build-essential libtool git-core libwmf0.2-7 libreadline8 \
|
||||
libpangocairo-1.0-0 libxt6 libjbig0 liblcms2-2 libtiff5 liblqr-1-0 libdjvulibre21 libfftw3-double3 libx265-192 \
|
||||
libwebpmux3 libwebpdemux2 libopenexr25 libilmbase25 libopenjp2-7 \
|
||||
&& apt-get -y build-dep imagemagick libmagickcore-dev libde265 libheif libfontconfig1 \
|
||||
&& cd /usr/src/ \
|
||||
&& git clone https://github.com/strukturag/libde265.git \
|
||||
&& git clone https://github.com/strukturag/libheif.git \
|
||||
&& cd libde265/ \
|
||||
&& ./autogen.sh \
|
||||
&& ./configure \
|
||||
&& make \
|
||||
&& make install \
|
||||
&& cd /usr/src/libheif/ \
|
||||
&& ./autogen.sh \
|
||||
&& ./configure \
|
||||
&& make \
|
||||
&& make install \
|
||||
&& mkdir /usr/src/ImageMagick \
|
||||
&& git clone https://github.com/ImageMagick/ImageMagick.git ImageMagick-7.0.11 \
|
||||
&& cd ImageMagick-7.0.11 \
|
||||
&& ./configure --with-heic=yes --with-modules \
|
||||
&& make install \
|
||||
&& ldconfig \
|
||||
&& apt-get install -y libbz2-dev libgmp-dev libpng-dev libjpeg-dev libfreetype6-dev --no-install-recommends \
|
||||
&& docker-php-ext-install -j$(nproc) gmp exif \
|
||||
&& install-php-extensions imagick \
|
||||
&& apt-get purge -y build-essential libtool wget *-dev \
|
||||
hicolor-icon-theme texlive-base texlive-binaries automake bsdmainutils doxygen \
|
||||
fonts-lmodern ghostscript graphviz gsfonts icu-devtools jdupes groff-base chrpath dbus \
|
||||
man-db python3 xsltproc \
|
||||
tex-common mime-support poppler-data preview-latex-style libgdk-pixbuf2.0-0 libgl1-mesa-dri libpaper1 libpulse0 \
|
||||
libqt5core5a libqt5gui5 libsensors-config libvdpau1 shared-mime-info libglib2.0-data libxml2-utils ttf-bitstream-vera libgvc6 \
|
||||
imagemagick-6-common \
|
||||
&& apt-get autoremove -y \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* \
|
||||
&& rm -rf /usr/src/libde265 /usr/src/libheif /usr/src/ImageMagick \
|
||||
&& mv /sbin/init.tmp /sbin/init
|
||||
|
18
Dockerfile.phptest
Normal file
18
Dockerfile.phptest
Normal file
@ -0,0 +1,18 @@
|
||||
# NAME leenooks/php
|
||||
# VERSION 8.1-fpm-image-test
|
||||
|
||||
FROM registry.leenooks.net/leenooks/php:8.1-fpm-image
|
||||
|
||||
RUN apt-get update && apt-get -y install wget build-essential \
|
||||
&& pecl install xdebug \
|
||||
&& docker-php-ext-enable xdebug \
|
||||
&& apt-get -y autoremove \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
RUN mv /sbin/init /sbin/init.orig \
|
||||
&& apt-get update && apt-get install -y npm \
|
||||
&& apt-get -y autoremove \
|
||||
&& apt-get clean \
|
||||
&& mv /sbin/init.orig /sbin/init \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
@ -1,20 +0,0 @@
|
||||
--- /etc/ssh/sshd_config.orig 2017-12-13 10:12:21.098005827 +0000
|
||||
+++ /etc/ssh/sshd_config 2017-12-13 10:14:11.461687661 +0000
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
# Authentication:
|
||||
LoginGraceTime 120
|
||||
-PermitRootLogin without-password
|
||||
+PermitRootLogin no
|
||||
StrictModes yes
|
||||
|
||||
RSAAuthentication yes
|
||||
@@ -49,7 +49,7 @@
|
||||
ChallengeResponseAuthentication no
|
||||
|
||||
# Change to no to disable tunnelled clear text passwords
|
||||
-#PasswordAuthentication yes
|
||||
+PasswordAuthentication no
|
||||
|
||||
# Kerberos options
|
||||
#KerberosAuthentication no
|
Loading…
Reference in New Issue
Block a user