Improve build caching and error handling for curl and gpg commands
authorJ0WI <redacted>
Tue, 4 Jun 2019 15:39:24 +0000 (17:39 +0200)
committerJ0WI <redacted>
Tue, 4 Jun 2019 15:42:07 +0000 (17:42 +0200)
php-apache/Dockerfile
php-fpm/Dockerfile

index f199ce901f881ee6ee61155a4066f7f1e03c3206..3cdfe2c7e57faeefd76c9fdd945ac4de4a1efc05 100644 (file)
@@ -48,9 +48,6 @@ RUN set -ex; \
 # enable mod_rewrite
 RUN a2enmod rewrite
 
-# use custom PHP settings
-COPY php.ini /usr/local/etc/php/conf.d/roundcube-defaults.ini
-
 # expose these volumes
 VOLUME /var/roundcube/config
 VOLUME /tmp/roundcube-temp
@@ -63,15 +60,15 @@ RUN set -ex; \
        fetchDeps="gnupg dirmngr"; \
        apt-get -qq update; \
        apt-get install -y --no-install-recommends $fetchDeps; \
-       curl -o roundcubemail.tar.gz -SL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz; \
-       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 -fSL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz; \
+       curl -o roundcubemail.tar.gz.asc -fSL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz.asc; \
        export GNUPGHOME="$(mktemp -d)"; \
        # workaround for "Cannot assign requested address", see e.g. https://github.com/inversepath/usbarmory-debian-base_image/issues/9
        echo "disable-ipv6" > "$GNUPGHOME/dirmngr.conf"; \
        # ha.pool.sks-keyservers.net seems to be unreliable, use pgp.mit.edu as fallback
-       gpg --no-tty --keyserver ha.pool.sks-keyservers.net --recv-keys F3E4C04BB3DB5D4215C45F7F5AB2BAA141C4F7D5 || gpg --no-tty --keyserver pgp.mit.edu --recv-keys F3E4C04BB3DB5D4215C45F7F5AB2BAA141C4F7D5; \
+       gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys F3E4C04BB3DB5D4215C45F7F5AB2BAA141C4F7D5 || gpg --batch --keyserver pgp.mit.edu --recv-keys F3E4C04BB3DB5D4215C45F7F5AB2BAA141C4F7D5; \
        gpg --batch --verify roundcubemail.tar.gz.asc roundcubemail.tar.gz; \
-       tar -xzf roundcubemail.tar.gz -C /usr/src/; \
+       tar -xf roundcubemail.tar.gz -C /usr/src/; \
        gpgconf --kill all; \
        rm -r "$GNUPGHOME" roundcubemail.tar.gz.asc roundcubemail.tar.gz; \
        # upstream tarballs include ./roundcubemail-${ROUNDCUBEMAIL_VERSION}/ so this gives us /usr/src/roundcubemail-${ROUNDCUBEMAIL_VERSION}
@@ -79,7 +76,10 @@ RUN set -ex; \
        rm -rf /usr/src/roundcubemail/installer
 
 # 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 -fL https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh > /wait-for-it.sh && chmod +x /wait-for-it.sh
+
+# use custom PHP settings
+COPY php.ini /usr/local/etc/php/conf.d/roundcube-defaults.ini
 
 COPY docker-entrypoint.sh /
 
index 12233e72ed8433af447ef8707a466e34c22540d1..fa1250491cf30fd52a48548daa47049cd6df03ce 100644 (file)
@@ -45,9 +45,6 @@ RUN set -ex; \
        apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
        rm -rf /var/lib/apt/lists/*
 
-# use custom PHP settings
-COPY php.ini /usr/local/etc/php/conf.d/roundcube-defaults.ini
-
 # expose these volumes
 VOLUME /var/roundcube/config
 VOLUME /var/www/html
@@ -60,15 +57,15 @@ RUN set -ex; \
        fetchDeps="gnupg dirmngr"; \
        apt-get -qq update; \
        apt-get install -y --no-install-recommends $fetchDeps; \
-       curl -o roundcubemail.tar.gz -SL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz; \
-       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 -fSL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz; \
+       curl -o roundcubemail.tar.gz.asc -fSL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz.asc; \
        export GNUPGHOME="$(mktemp -d)"; \
        # workaround for "Cannot assign requested address", see e.g. https://github.com/inversepath/usbarmory-debian-base_image/issues/9
        echo "disable-ipv6" > "$GNUPGHOME/dirmngr.conf"; \
        # ha.pool.sks-keyservers.net seems to be unreliable, use pgp.mit.edu as fallback
-       gpg --no-tty --keyserver ha.pool.sks-keyservers.net --recv-keys F3E4C04BB3DB5D4215C45F7F5AB2BAA141C4F7D5 || gpg --no-tty --keyserver pgp.mit.edu --recv-keys F3E4C04BB3DB5D4215C45F7F5AB2BAA141C4F7D5; \
+       gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys F3E4C04BB3DB5D4215C45F7F5AB2BAA141C4F7D5 || gpg --batch --keyserver pgp.mit.edu --recv-keys F3E4C04BB3DB5D4215C45F7F5AB2BAA141C4F7D5; \
        gpg --batch --verify roundcubemail.tar.gz.asc roundcubemail.tar.gz; \
-       tar -xzf roundcubemail.tar.gz -C /usr/src/; \
+       tar -xf roundcubemail.tar.gz -C /usr/src/; \
        gpgconf --kill all; \
        rm -r "$GNUPGHOME" roundcubemail.tar.gz.asc roundcubemail.tar.gz; \
        # upstream tarballs include ./roundcubemail-${ROUNDCUBEMAIL_VERSION}/ so this gives us /usr/src/roundcubemail-${ROUNDCUBEMAIL_VERSION}
@@ -76,7 +73,10 @@ RUN set -ex; \
        rm -rf /usr/src/roundcubemail/installer
 
 # 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 -fL https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh > /wait-for-it.sh && chmod +x /wait-for-it.sh
+
+# use custom PHP settings
+COPY php.ini /usr/local/etc/php/conf.d/roundcube-defaults.ini
 
 COPY docker-entrypoint.sh /
 
git clone https://git.99rst.org/PROJECT