Compare commits
22 Commits
master
...
old-server
Author | SHA1 | Date | |
---|---|---|---|
|
5ca16a0d38 | ||
|
1f3a2cc04f | ||
|
9c00fd3eb5 | ||
|
0a92327117 | ||
|
9ec44c6646 | ||
|
972a4aeaf8 | ||
|
6cd2f36bbc | ||
|
7869fc6f50 | ||
|
88c1064ebd | ||
|
ab12261b81 | ||
|
ec8accdf4a | ||
|
8f38abdaa5 | ||
|
99dbe0d13d | ||
|
a20a865d55 | ||
|
34d0a7416c | ||
|
bc3a465c0f | ||
|
cd409b2002 | ||
|
b29603092e | ||
|
68c1281162 | ||
|
921575772f | ||
|
5bf33b84ee | ||
|
99791da0ec |
@ -1,42 +1,46 @@
|
|||||||
image: docker:latest
|
image: docker:latest
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- test
|
|
||||||
- build
|
- build
|
||||||
|
- build-test
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
BRANCH: plus
|
BRANCH: server
|
||||||
VERSION: 7.1-fpm-${BRANCH}
|
VERSION: 8.1-fpm-${BRANCH}
|
||||||
CACHETAG: build-${BRANCH}
|
CACHETAG: build-${BRANCH}
|
||||||
DOCKER_REGISTRY: registry.leenooks.net
|
DOCKER_HOST: tcp://docker:2375
|
||||||
DOCKER_HOST: tcp://${DOCKER_REGISTRY}-leenooks-ci-docker:2375
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- ${DOCKER_REGISTRY}/leenooks/ci-docker:dind
|
- docker:dind
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- docker info
|
- docker info
|
||||||
- docker version
|
- 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:
|
x86_64:build:
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- cat /etc/hosts
|
|
||||||
- env|sort
|
|
||||||
- docker build -t ${CI_REGISTRY_IMAGE}:${VERSION} .
|
|
||||||
- docker images
|
|
||||||
only:
|
|
||||||
- debug
|
|
||||||
|
|
||||||
build:
|
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
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 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}:${VERSION}
|
||||||
- docker push ${CI_REGISTRY_IMAGE}:${CACHETAG}
|
- docker push ${CI_REGISTRY_IMAGE}:${CACHETAG}
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
- x86_64
|
||||||
only:
|
only:
|
||||||
- plus
|
- server
|
||||||
|
|
||||||
|
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:
|
||||||
|
- server
|
||||||
|
23
Dockerfile
23
Dockerfile
@ -1,23 +1,6 @@
|
|||||||
# NAME leenooks/php
|
# NAME leenooks/php
|
||||||
# VERSION 7.1-fpm-plus
|
# VERSION 8.1-fpm-server
|
||||||
|
|
||||||
FROM php:7.1-fpm
|
FROM registry.leenooks.net/leenooks/php:8.1-fpm-latest
|
||||||
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/*
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y openssh-server && rm -rf /var/lib/apt/lists/* \
|
RUN CFLAGS="$CFLAGS -D_GNU_SOURCE" docker-php-ext-install -j$(nproc) sockets pcntl
|
||||||
&& useradd -c "Hosting Admin User" -u 1000 -g users -G www-data -d /var/www/html -M lamp
|
|
||||||
|
|
||||||
EXPOSE 9000/tcp 22/tcp
|
|
||||||
|
|
||||||
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"]
|
|
||||||
|
14
Dockerfile.phptest
Normal file
14
Dockerfile.phptest
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# NAME leenooks/php
|
||||||
|
# VERSION 8.1-fpm-server-test
|
||||||
|
|
||||||
|
FROM registry.leenooks.net/leenooks/php:8.1-fpm-server
|
||||||
|
|
||||||
|
RUN pecl install xdebug \
|
||||||
|
&& docker-php-ext-enable xdebug
|
||||||
|
|
||||||
|
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