Merge pull request #54 from J0WI/flags

Improve build caching and error handling for curl and gpg commands
This commit is contained in:
Mathieu Brunot 2019-06-04 18:43:19 +02:00 committed by GitHub
commit d2480dcbfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 16 deletions

View 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 /

View 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 /