summaryrefslogtreecommitdiffstats
path: root/res/docker/docker-entrypoint.sh
diff options
context:
space:
mode:
authoryangyan <yangyanyj@chinamobile.com>2020-03-03 15:41:04 +0800
committeryangyan <yangyanyj@chinamobile.com>2020-03-03 15:41:19 +0800
commit01b30541d4c357c9dd66aa2e90ee35945e4422da (patch)
tree7375d7b20f3c38a1acfacbd6031b447c357cb25a /res/docker/docker-entrypoint.sh
parent8570673356456e08fdf110e7d55fcbd904ea1591 (diff)
Modify DB initialization completion judgment flag1.3.7
Change-Id: Ia91f2cb283504c28e6bc0208b2e91ea444b455a1 Issue-ID: VFC-1639 Signed-off-by: yangyan <yangyanyj@chinamobile.com>
Diffstat (limited to 'res/docker/docker-entrypoint.sh')
-rwxr-xr-xres/docker/docker-entrypoint.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/res/docker/docker-entrypoint.sh b/res/docker/docker-entrypoint.sh
index 60abc80..0f85abd 100755
--- a/res/docker/docker-entrypoint.sh
+++ b/res/docker/docker-entrypoint.sh
@@ -31,8 +31,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