mirror of
https://github.com/apache/druid.git
synced 2025-02-06 01:58:20 +00:00
Allow Dockerfile to exit after 3 failures
This commit is contained in:
parent
4648a41cab
commit
731b78fb47
@ -27,15 +27,17 @@ ARG ZK_VERSION
|
|||||||
ARG APACHE_ARCHIVE_MIRROR_HOST=https://archive.apache.org
|
ARG APACHE_ARCHIVE_MIRROR_HOST=https://archive.apache.org
|
||||||
ARG SETUP_RETRIES=3
|
ARG SETUP_RETRIES=3
|
||||||
# Retry mechanism for running the setup script up to limit of 3 times.
|
# Retry mechanism for running the setup script up to limit of 3 times.
|
||||||
RUN set -e; \
|
RUN for i in $(seq 1 $SETUP_RETRIES); do \
|
||||||
for i in $(seq 1 $SETUP_RETRIES); do \
|
|
||||||
echo "Attempt $i to run the setup script..."; \
|
echo "Attempt $i to run the setup script..."; \
|
||||||
APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST} /root/base-setup.sh && break || { \
|
APACHE_ARCHIVE_MIRROR_HOST=${APACHE_ARCHIVE_MIRROR_HOST} /root/base-setup.sh && break || { \
|
||||||
echo "Set up script attempt $i/$SETUP_RETRIES failed."; \
|
echo "Set up script attempt $i/$SETUP_RETRIES failed."; \
|
||||||
sleep 2; \
|
sleep 2; \
|
||||||
}; \
|
}; \
|
||||||
done; \
|
done; \
|
||||||
rm -f /root/base-setup.sh
|
rm -f /root/base-setup.sh; \
|
||||||
|
if [ "$i" -eq "$SETUP_RETRIES" ]; then \
|
||||||
|
exit 1; \
|
||||||
|
fi; \
|
||||||
|
|
||||||
FROM druidbase
|
FROM druidbase
|
||||||
ARG MYSQL_VERSION
|
ARG MYSQL_VERSION
|
||||||
|
Loading…
x
Reference in New Issue
Block a user