aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryangyan <yangyanyj@chinamobile.com>2020-03-03 15:08:10 +0800
committeryangyan <yangyanyj@chinamobile.com>2020-03-03 15:08:15 +0800
commitee1d3383998beb1d4a8ff384b827f0aacd004e71 (patch)
treef3bd657117c04dda56164ce28b64e6059697cd5b
parentce7144ab2975f20a674b58688f379f68982de6fe (diff)
Modify DB initialization completion judgment flag
Change-Id: I8a9ad0b37c41a9f56f3b4b8f26491883b7e8caaa Issue-ID: VFC-1639 Signed-off-by: yangyan <yangyanyj@chinamobile.com>
-rwxr-xr-xdocker/docker-entrypoint.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh
index c0f2d8f0..24dce8aa 100755
--- a/docker/docker-entrypoint.sh
+++ b/docker/docker-entrypoint.sh
@@ -34,8 +34,8 @@ done
# Wait for DB initialization
echo "Wait for DB initialization"
for i in {1..5}; do
- curl -sS -m 1 $MYSQL_ADDR > /dev/null && break
- sleep $i
+ mysql -u$MYSQL_ROOT_USER1 -p$MYSQL_ROOT_PASSWORD -h`echo $MYSQL_ADDR | cut -d: -f 1` -P`echo $MYSQL_ADDR | cut -d: -f 2` -e "show databases;" > /dev/null && echo "DB initialization completed" && break
+ sleep $i && echo "`echo $MYSQL_ADDR | cut -d: -f 1` connection failed"
done
# Configure service based on docker environment variables