Add sha256 check, shell debug log and PHP production config

This commit is contained in:
Markus Opolka
2019-02-19 10:34:05 +01:00
parent 27a563868d
commit 90c03f7b92
3 changed files with 124 additions and 85 deletions

View File

@@ -1,11 +1,14 @@
FROM php:7.2-apache FROM php:7.2-apache
LABEL maintainer="markus@martialblog.de" LABEL maintainer="markus@martialblog.de"
ARG version='3.15.8+190130' ARG version='3.15.8+190130'
ARG sha256_checksum='0eb46c81c8fce8eb40625a899ed3a32a2f63a4dd9158da7ee2df2d78a67d4c0b'
# Install OS dependencies # Install OS dependencies
RUN apt-get update && \ RUN set -ex; \
apt-get update && \
DEBIAN_FRONTEND=noninteractive \ DEBIAN_FRONTEND=noninteractive \
apt-get install --no-install-recommends -y \ apt-get install --no-install-recommends -y \
\
libldap2-dev \ libldap2-dev \
zlib1g-dev \ zlib1g-dev \
libc-client-dev \ libc-client-dev \
@@ -13,16 +16,18 @@ RUN apt-get update && \
libpng-dev \ libpng-dev \
libpq-dev \ libpq-dev \
netcat \ netcat \
&& apt-get autoclean; apt-get autoremove && \ \
&& apt-get autoclean; apt-get autoremove; \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# Link LDAP library for PHP ldap extension # Link LDAP library for PHP ldap extension
RUN ln -fs /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/ RUN set -ex; \
# Configure PHP imap plugin ln -fs /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/
RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl
# Install PHP Plugins # Install PHP Plugins and Configure PHP imap plugin
RUN docker-php-ext-install -j5 \ RUN set -ex; \
docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
docker-php-ext-install -j5 \
gd \ gd \
imap \ imap \
ldap \ ldap \
@@ -33,15 +38,32 @@ RUN docker-php-ext-install -j5 \
pgsql \ pgsql \
zip zip
# Download, unzip and chmod of LimeSurvey ENV LIMESURVEY_VERSION=$version
# Apache configuration
RUN a2enmod headers rewrite remoteip; \
{\
echo RemoteIPHeader X-Real-IP ;\
echo RemoteIPTrustedProxy 10.0.0.0/8 ;\
echo RemoteIPTrustedProxy 172.16.0.0/12 ;\
echo RemoteIPTrustedProxy 192.168.0.0/16 ;\
} > /etc/apache2/conf-available/remoteip.conf;\
a2enconf remoteip
# Use the default production configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
# Download, unzip and chmod LimeSurvey from official GitHub repository
ADD "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" /tmp ADD "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" /tmp
RUN tar xzvf "/tmp/${version}.tar.gz" --strip-components=1 -C /var/www/html/ && \ RUN set -ex; \
rm "/tmp/${version}.tar.gz" && \ echo "${sha256_checksum} /tmp/${version}.tar.gz" | sha256sum -c - && \
\
tar xzvf "/tmp/${version}.tar.gz" --strip-components=1 -C /var/www/html/ && \
rm -f "/tmp/${version}.tar.gz" && \
chown -R www-data:www-data /var/www/html chown -R www-data:www-data /var/www/html
RUN a2enmod headers rewrite remoteip
COPY entrypoint.sh entrypoint.sh COPY entrypoint.sh entrypoint.sh
ENTRYPOINT ["/var/www/html/entrypoint.sh"] ENTRYPOINT ["/var/www/html/entrypoint.sh"]
CMD ["apache2-foreground"] CMD ["apache2-foreground"]

View File

@@ -1,9 +1,11 @@
FROM php:7.2-fpm-alpine FROM php:7.2-fpm-alpine
LABEL maintainer="markus@martialblog.de" LABEL maintainer="markus@martialblog.de"
ARG version='3.15.8+190130' ARG version='3.15.8+190130'
ARG sha256_checksum='0eb46c81c8fce8eb40625a899ed3a32a2f63a4dd9158da7ee2df2d78a67d4c0b'
# Install OS dependencies # Install OS dependencies
RUN apk add --no-cache --virtual .build-deps \ RUN set -ex; \
apk add --no-cache --virtual .build-deps \
libpng-dev \ libpng-dev \
openldap-dev \ openldap-dev \
imap-dev \ imap-dev \
@@ -11,7 +13,8 @@ RUN apk add --no-cache --virtual .build-deps \
apk add --no-cache netcat-openbsd bash apk add --no-cache netcat-openbsd bash
# Install PHP Plugins # Install PHP Plugins
RUN docker-php-ext-configure imap --with-imap-ssl && \ RUN set -ex; \
docker-php-ext-configure imap --with-imap-ssl && \
docker-php-ext-install \ docker-php-ext-install \
gd \ gd \
imap \ imap \
@@ -26,7 +29,11 @@ RUN docker-php-ext-configure imap --with-imap-ssl && \
# Download, unzip and chmod of LimeSurvey # Download, unzip and chmod of LimeSurvey
ADD "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" /tmp ADD "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" /tmp
RUN tar xzvf "/tmp/${version}.tar.gz" --strip-components=1 -C /var/www/html/ && \ RUN set -ex; \
echo "${sha256_checksum} /tmp/${version}.tar.gz" | sha256sum -c - && \
\
tar xzvf "/tmp/${version}.tar.gz" --strip-components=1 -C /var/www/html/ && \
\
rm -rf "/tmp/${version}.tar.gz" \ rm -rf "/tmp/${version}.tar.gz" \
/var/www/html/docs \ /var/www/html/docs \
/var/www/html/tests \ /var/www/html/tests \

View File

@@ -1,11 +1,14 @@
FROM php:7.2-fpm FROM php:7.2-fpm
LABEL maintainer="markus@martialblog.de" LABEL maintainer="markus@martialblog.de"
ARG version='3.15.8+190130' ARG version='3.15.8+190130'
ARG sha256_checksum='0eb46c81c8fce8eb40625a899ed3a32a2f63a4dd9158da7ee2df2d78a67d4c0b'
# Install OS dependencies # Install OS dependencies
RUN apt-get update && \ RUN set -ex; \
apt-get update && \
DEBIAN_FRONTEND=noninteractive \ DEBIAN_FRONTEND=noninteractive \
apt-get install --no-install-recommends -y \ apt-get install --no-install-recommends -y \
\
libldap2-dev \ libldap2-dev \
zlib1g-dev \ zlib1g-dev \
libc-client-dev \ libc-client-dev \
@@ -13,16 +16,18 @@ RUN apt-get update && \
libpng-dev \ libpng-dev \
libpq-dev \ libpq-dev \
netcat \ netcat \
&& apt-get autoclean; apt-get autoremove && \ \
&& apt-get autoclean; apt-get autoremove; \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# Link LDAP library for PHP ldap extension # Link LDAP library for PHP ldap extension
RUN ln -fs /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/ RUN set -ex; \
ln -fs /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/
RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl # Install PHP Plugins and Configure PHP imap plugin
RUN set -ex; \
# Install PHP Plugins docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
RUN docker-php-ext-install -j5 \ docker-php-ext-install -j5 \
gd \ gd \
imap \ imap \
ldap \ ldap \
@@ -33,11 +38,16 @@ RUN docker-php-ext-install -j5 \
pgsql \ pgsql \
zip zip
# Download, unzip and chmod of LimeSurvey ENV LIMESURVEY_VERSION=$version
# Download, unzip and chmod LimeSurvey from official GitHub repository
ADD "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" /tmp ADD "https://github.com/LimeSurvey/LimeSurvey/archive/${version}.tar.gz" /tmp
RUN tar xzvf "/tmp/${version}.tar.gz" --strip-components=1 -C /var/www/html/ && \ RUN set -ex; \
rm "/tmp/${version}.tar.gz" && \ echo "${sha256_checksum} /tmp/${version}.tar.gz" | sha256sum -c - && \
\
tar xzvf "/tmp/${version}.tar.gz" --strip-components=1 -C /var/www/html/ && \
rm -f "/tmp/${version}.tar.gz" && \
chown -R www-data:www-data /var/www/html chown -R www-data:www-data /var/www/html
EXPOSE 9000 EXPOSE 9000