summaryrefslogtreecommitdiffstats
path: root/docker
diff options
context:
space:
mode:
authoryangyan <yangyanyj@chinamobile.com>2020-03-03 15:29:09 +0800
committeryangyan <yangyanyj@chinamobile.com>2020-03-03 15:29:14 +0800
commit60a0f1e00ab5681629db1a210e3089f8a0eff46e (patch)
tree89e6eebb1285b4cdb04f7169a85dd29cfff385fa /docker
parentc6df4fc3129647a77f0ddcd72636d51754015b31 (diff)
Modify DB initialization completion judgment flag1.3.7
Change-Id: I02100232042f8b3a31414246e6231eb579139906 Issue-ID: VFC-1639 Signed-off-by: yangyan <yangyanyj@chinamobile.com>
Diffstat (limited to 'docker')
-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 624e3d31..89136672 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_USER -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