Compare commits
21 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f1c2509579 | ||
|
2e582eec24 | ||
|
e2704526c7 | ||
|
abe19134e8 | ||
|
5c1de20bd9 | ||
|
70276ff5c3 | ||
|
d798579306 | ||
|
106ed1d530 | ||
|
4cd10e8d0c | ||
|
9a20da3294 | ||
|
a044159d41 | ||
|
12c45fb552 | ||
|
abedd9b6e6 | ||
|
e7e10b349f | ||
|
39d7aaab42 | ||
|
3279c0e869 | ||
|
1aceeb1d65 | ||
|
6d6abf85ab | ||
|
4ecbcfe835 | ||
|
4b412d555e | ||
|
99791da0ec |
@ -3,21 +3,21 @@ image: docker:latest
|
||||
stages:
|
||||
- test
|
||||
- build
|
||||
- build-test
|
||||
|
||||
variables:
|
||||
BRANCH: plus
|
||||
VERSION: 7.1-fpm-${BRANCH}
|
||||
BRANCH: ext
|
||||
VERSION: 8.0-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
|
||||
@ -29,14 +29,29 @@ test:
|
||||
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
|
||||
- ext
|
||||
|
||||
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:
|
||||
- ext
|
||||
|
41
Dockerfile
41
Dockerfile
@ -1,23 +1,30 @@
|
||||
# NAME leenooks/php
|
||||
# VERSION 7.1-fpm-plus
|
||||
# VERSION 8.0-fpm-ext
|
||||
|
||||
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 \
|
||||
FROM registry.leenooks.net/leenooks/php:8.0-fpm-plus
|
||||
|
||||
RUN mv /sbin/init /sbin/init.tmp \
|
||||
&& echo "deb http://deb.debian.org/debian buster non-free" >> /etc/apt/sources.list.d/non-free.list && apt-get update \
|
||||
&& apt-get install -y mariadb-client-10.3 inetutils-ping fping pkg-config \
|
||||
libsnmp-dev snmp-mibs-downloader --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/*
|
||||
&& docker-php-ext-install -j$(nproc) snmp \
|
||||
&& apt purge -yqq systemd-sysv dconf-service \
|
||||
&& apt autoremove -yqq \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* \
|
||||
&& mv /sbin/init.tmp /sbin/init
|
||||
|
||||
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
|
||||
# Add Mongo DB
|
||||
RUN pecl install mongodb && docker-php-ext-enable mongodb \
|
||||
&& rm -rf /tmp/* \
|
||||
|
||||
EXPOSE 9000/tcp 22/tcp
|
||||
# Add in Leenooks' apt repository
|
||||
RUN curl -sL http://apt.leenooks.net/setup.sh | DISTRO=buster bash
|
||||
|
||||
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 \
|
||||
&& 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
|
||||
|
12
Dockerfile.phptest
Normal file
12
Dockerfile.phptest
Normal file
@ -0,0 +1,12 @@
|
||||
# NAME leenooks/php
|
||||
# VERSION 8.0-fpm-test
|
||||
|
||||
FROM registry.leenooks.net/leenooks/php:8.0-fpm-ext
|
||||
|
||||
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/*
|
@ -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