Change code style to the common format used by upstream images

This commit is contained in:
J0WI 2018-04-29 23:06:25 +02:00
parent 8c21da90c6
commit 380351ca47
2 changed files with 84 additions and 52 deletions

View File

@ -1,20 +1,36 @@
FROM php:7.1-apache FROM php:7.1-apache
LABEL maintainer="Thomas Bruederli <thomas@roundcube.net>" LABEL maintainer="Thomas Bruederli <thomas@roundcube.net>"
RUN apt-get -qq update \ RUN set -ex; \
&& apt-get install -qq \ apt-get update; \
libfreetype6-dev \ \
libicu-dev \ apt-get install -y --no-install-recommends \
libjpeg62-turbo-dev \ libfreetype6-dev \
libldap2-dev \ libicu-dev \
libpng-dev \ libjpeg62-turbo-dev \
libpq-dev \ libldap2-dev \
libsqlite3-dev \ libpng-dev \
zlib1g-dev \ libpq-dev \
&& rm -rf /var/lib/apt/lists/* libsqlite3-dev \
RUN docker-php-ext-install -j$(nproc) exif intl pdo pdo_mysql pdo_pgsql pdo_sqlite zip zlib1g-dev \
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd ; \
RUN docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu && docker-php-ext-install -j$(nproc) ldap \
debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \
docker-php-ext-install \
exif \
gd \
intl \
ldap \
pdo \
pdo_mysql \
pdo_pgsql \
pdo_sqlite \
zip \
; \
\
rm -rf /var/lib/apt/lists/*
# enable mod_rewrite # enable mod_rewrite
RUN a2enmod rewrite RUN a2enmod rewrite
@ -27,17 +43,18 @@ VOLUME /tmp/roundcube-temp
ENV ROUNDCUBEMAIL_VERSION 1.3.6 ENV ROUNDCUBEMAIL_VERSION 1.3.6
# Download package and extract to web volume # Download package and extract to web volume
RUN curl -o roundcubemail.tar.gz -SL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz \ RUN set -ex; \
&& curl -o roundcubemail.tar.gz.asc -SL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz.asc \ curl -o roundcubemail.tar.gz -SL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz; \
&& export GNUPGHOME="$(mktemp -d)" \ curl -o roundcubemail.tar.gz.asc -SL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz.asc; \
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys F3E4C04BB3DB5D4215C45F7F5AB2BAA141C4F7D5 \ export GNUPGHOME="$(mktemp -d)"; \
&& gpg --batch --verify roundcubemail.tar.gz.asc roundcubemail.tar.gz \ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys F3E4C04BB3DB5D4215C45F7F5AB2BAA141C4F7D5; \
&& rm -r "$GNUPGHOME" roundcubemail.tar.gz.asc \ gpg --batch --verify roundcubemail.tar.gz.asc roundcubemail.tar.gz; \
&& tar -xzf roundcubemail.tar.gz -C /usr/src/ \ rm -r "$GNUPGHOME" roundcubemail.tar.gz.asc; \
# upstream tarballs include ./roundcubemail-${ROUNDCUBEMAIL_VERSION}/ so this gives us /usr/src/roundcubemail-${ROUNDCUBEMAIL_VERSION} tar -xzf roundcubemail.tar.gz -C /usr/src/; \
&& mv /usr/src/roundcubemail-${ROUNDCUBEMAIL_VERSION} /usr/src/roundcubemail \ # upstream tarballs include ./roundcubemail-${ROUNDCUBEMAIL_VERSION}/ so this gives us /usr/src/roundcubemail-${ROUNDCUBEMAIL_VERSION}
&& rm -rf /usr/src/roundcubemail/installer \ mv /usr/src/roundcubemail-${ROUNDCUBEMAIL_VERSION} /usr/src/roundcubemail; \
&& rm roundcubemail.tar.gz rm -rf /usr/src/roundcubemail/installer; \
rm roundcubemail.tar.gz
# include the wait-for-it.sh script # include the wait-for-it.sh script
RUN curl https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh > /wait-for-it.sh && chmod +x /wait-for-it.sh RUN curl https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh > /wait-for-it.sh && chmod +x /wait-for-it.sh
@ -46,4 +63,3 @@ COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["apache2-foreground"] CMD ["apache2-foreground"]

View File

@ -1,20 +1,36 @@
FROM php:7.1-fpm FROM php:7.1-fpm
LABEL maintainer="Thomas Bruederli <thomas@roundcube.net>" LABEL maintainer="Thomas Bruederli <thomas@roundcube.net>"
RUN apt-get -qq update \ RUN set -ex; \
&& apt-get install -qq \ apt-get update; \
libfreetype6-dev \ \
libicu-dev \ apt-get install -y --no-install-recommends \
libjpeg62-turbo-dev \ libfreetype6-dev \
libldap2-dev \ libicu-dev \
libpng-dev \ libjpeg62-turbo-dev \
libpq-dev \ libldap2-dev \
libsqlite3-dev \ libpng-dev \
zlib1g-dev \ libpq-dev \
&& rm -rf /var/lib/apt/lists/* libsqlite3-dev \
RUN docker-php-ext-install -j$(nproc) exif intl pdo pdo_mysql pdo_pgsql pdo_sqlite zip zlib1g-dev \
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd ; \
RUN docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu && docker-php-ext-install -j$(nproc) ldap \
debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \
docker-php-ext-install \
exif \
gd \
intl \
ldap \
pdo \
pdo_mysql \
pdo_pgsql \
pdo_sqlite \
zip \
; \
\
rm -rf /var/lib/apt/lists/*
# expose these volumes # expose these volumes
VOLUME /var/roundcube/config VOLUME /var/roundcube/config
@ -24,17 +40,18 @@ VOLUME /var/www/html
ENV ROUNDCUBEMAIL_VERSION 1.3.6 ENV ROUNDCUBEMAIL_VERSION 1.3.6
# Download package and extract to web volume # Download package and extract to web volume
RUN curl -o roundcubemail.tar.gz -SL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz \ RUN set -ex; \
&& curl -o roundcubemail.tar.gz.asc -SL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz.asc \ curl -o roundcubemail.tar.gz -SL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz; \
&& export GNUPGHOME="$(mktemp -d)" \ curl -o roundcubemail.tar.gz.asc -SL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz.asc; \
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys F3E4C04BB3DB5D4215C45F7F5AB2BAA141C4F7D5 \ export GNUPGHOME="$(mktemp -d)"; \
&& gpg --batch --verify roundcubemail.tar.gz.asc roundcubemail.tar.gz \ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys F3E4C04BB3DB5D4215C45F7F5AB2BAA141C4F7D5; \
&& rm -r "$GNUPGHOME" roundcubemail.tar.gz.asc \ gpg --batch --verify roundcubemail.tar.gz.asc roundcubemail.tar.gz; \
&& tar -xzf roundcubemail.tar.gz -C /usr/src/ \ rm -r "$GNUPGHOME" roundcubemail.tar.gz.asc; \
# upstream tarballs include ./roundcubemail-${ROUNDCUBEMAIL_VERSION}/ so this gives us /usr/src/roundcubemail-${ROUNDCUBEMAIL_VERSION} tar -xzf roundcubemail.tar.gz -C /usr/src/; \
&& mv /usr/src/roundcubemail-${ROUNDCUBEMAIL_VERSION} /usr/src/roundcubemail \ # upstream tarballs include ./roundcubemail-${ROUNDCUBEMAIL_VERSION}/ so this gives us /usr/src/roundcubemail-${ROUNDCUBEMAIL_VERSION}
&& rm -rf /usr/src/roundcubemail/installer \ mv /usr/src/roundcubemail-${ROUNDCUBEMAIL_VERSION} /usr/src/roundcubemail; \
&& rm roundcubemail.tar.gz rm -rf /usr/src/roundcubemail/installer; \
rm roundcubemail.tar.gz
# include the wait-for-it.sh script # include the wait-for-it.sh script
RUN curl https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh > /wait-for-it.sh && chmod +x /wait-for-it.sh RUN curl https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh > /wait-for-it.sh && chmod +x /wait-for-it.sh
@ -43,4 +60,3 @@ COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["php-fpm"] CMD ["php-fpm"]