Improve build caching and error handling for curl and gpg commands
This commit is contained in:
parent
1b8574bd88
commit
8d84ba7df0
@ -48,9 +48,6 @@ RUN set -ex; \
|
|||||||
# enable mod_rewrite
|
# enable mod_rewrite
|
||||||
RUN a2enmod rewrite
|
RUN a2enmod rewrite
|
||||||
|
|
||||||
# use custom PHP settings
|
|
||||||
COPY php.ini /usr/local/etc/php/conf.d/roundcube-defaults.ini
|
|
||||||
|
|
||||||
# expose these volumes
|
# expose these volumes
|
||||||
VOLUME /var/roundcube/config
|
VOLUME /var/roundcube/config
|
||||||
VOLUME /tmp/roundcube-temp
|
VOLUME /tmp/roundcube-temp
|
||||||
@ -63,15 +60,15 @@ RUN set -ex; \
|
|||||||
fetchDeps="gnupg dirmngr"; \
|
fetchDeps="gnupg dirmngr"; \
|
||||||
apt-get -qq update; \
|
apt-get -qq update; \
|
||||||
apt-get install -y --no-install-recommends $fetchDeps; \
|
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 -fSL 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.asc -fSL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz.asc; \
|
||||||
export GNUPGHOME="$(mktemp -d)"; \
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
# workaround for "Cannot assign requested address", see e.g. https://github.com/inversepath/usbarmory-debian-base_image/issues/9
|
# 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"; \
|
echo "disable-ipv6" > "$GNUPGHOME/dirmngr.conf"; \
|
||||||
# ha.pool.sks-keyservers.net seems to be unreliable, use pgp.mit.edu as fallback
|
# 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; \
|
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; \
|
gpgconf --kill all; \
|
||||||
rm -r "$GNUPGHOME" roundcubemail.tar.gz.asc roundcubemail.tar.gz; \
|
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}
|
# 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
|
rm -rf /usr/src/roundcubemail/installer
|
||||||
|
|
||||||
# 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 -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 /
|
COPY docker-entrypoint.sh /
|
||||||
|
|
||||||
|
@ -45,9 +45,6 @@ RUN set -ex; \
|
|||||||
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
|
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
|
||||||
rm -rf /var/lib/apt/lists/*
|
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
|
# expose these volumes
|
||||||
VOLUME /var/roundcube/config
|
VOLUME /var/roundcube/config
|
||||||
VOLUME /var/www/html
|
VOLUME /var/www/html
|
||||||
@ -60,15 +57,15 @@ RUN set -ex; \
|
|||||||
fetchDeps="gnupg dirmngr"; \
|
fetchDeps="gnupg dirmngr"; \
|
||||||
apt-get -qq update; \
|
apt-get -qq update; \
|
||||||
apt-get install -y --no-install-recommends $fetchDeps; \
|
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 -fSL 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.asc -fSL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz.asc; \
|
||||||
export GNUPGHOME="$(mktemp -d)"; \
|
export GNUPGHOME="$(mktemp -d)"; \
|
||||||
# workaround for "Cannot assign requested address", see e.g. https://github.com/inversepath/usbarmory-debian-base_image/issues/9
|
# 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"; \
|
echo "disable-ipv6" > "$GNUPGHOME/dirmngr.conf"; \
|
||||||
# ha.pool.sks-keyservers.net seems to be unreliable, use pgp.mit.edu as fallback
|
# 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; \
|
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; \
|
gpgconf --kill all; \
|
||||||
rm -r "$GNUPGHOME" roundcubemail.tar.gz.asc roundcubemail.tar.gz; \
|
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}
|
# 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
|
rm -rf /usr/src/roundcubemail/installer
|
||||||
|
|
||||||
# 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 -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 /
|
COPY docker-entrypoint.sh /
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user