This commit is contained in:
William Lachance 2019-04-02 16:09:00 -04:00 коммит произвёл William Lachance
Родитель 36ae8d89af
Коммит 14fef26e20
2 изменённых файлов: 3 добавлений и 5 удалений

Просмотреть файл

@ -17,7 +17,7 @@ RUN mkdir -p \
/usr/share/man/man8 && \ /usr/share/man/man8 && \
apt-get update && \ apt-get update && \
apt-get install -y --no-install-recommends build-essential libpq-dev \ apt-get install -y --no-install-recommends build-essential libpq-dev \
mime-support postgresql-client gettext curl && \ mime-support postgresql-client gettext curl netcat && \
apt-get autoremove -y && \ apt-get autoremove -y && \
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Просмотреть файл

@ -16,11 +16,9 @@ usage() {
wait_for() { wait_for() {
tries=0 tries=0
echo "Waiting for $1 to listen on $2..." echo "Waiting for $1 to listen on $2..."
while true; do until nc -z $1 $2; do
[[ $tries -lt $TRIES ]] || return
(echo > /dev/tcp/$1/$2) >/dev/null 2>&1
result=
[[ $? -eq 0 ]] && return [[ $? -eq 0 ]] && return
[[ $tries -lt $TRIES ]] || (echo "Timed out!" && exit 1)
sleep $SLEEP sleep $SLEEP
tries=$((tries + 1)) tries=$((tries + 1))
done done