diff options
author | yangyan <yangyanyj@chinamobile.com> | 2020-03-03 15:08:10 +0800 |
---|---|---|
committer | yangyan <yangyanyj@chinamobile.com> | 2020-03-03 15:08:15 +0800 |
commit | ee1d3383998beb1d4a8ff384b827f0aacd004e71 (patch) | |
tree | f3bd657117c04dda56164ce28b64e6059697cd5b | |
parent | ce7144ab2975f20a674b58688f379f68982de6fe (diff) |
Modify DB initialization completion judgment flag
Change-Id: I8a9ad0b37c41a9f56f3b4b8f26491883b7e8caaa
Issue-ID: VFC-1639
Signed-off-by: yangyan <yangyanyj@chinamobile.com>
-rwxr-xr-x | docker/docker-entrypoint.sh | 4 |
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 |