File tree 2 files changed +12
-6
lines changed
2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,6 @@ RUN chmod +x /usr/config/configure-db.sh
14
14
ENTRYPOINT ["./entrypoint.sh" ]
15
15
16
16
# Tail the setup logs to trap the process
17
- CMD ["tail -f /var/opt/mssql/log/errorlog* " ]
17
+ CMD ["tail -f /dev/null " ]
18
18
19
- HEALTHCHECK --interval=15s CMD grep -q "MSSQL CONFIG COMPLETE" ./config.log
19
+ HEALTHCHECK --interval=15s CMD /opt/mssql-tools/bin/sqlcmd -U sa -P $SA_PASSWORD -Q "select 1" && grep -q "MSSQL CONFIG COMPLETE" ./config.log
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
# wait for MSSQL server to start
4
- export STATUS=0
4
+ export STATUS=1
5
5
i=0
6
- while [[ $STATUS -eq 0 ]] || [[ $i -lt 30 ]] ; do
7
- sleep 1
6
+
7
+ while [[ $STATUS -ne 0 ]] && [[ $i -lt 30 ]] ; do
8
8
i=$i +1
9
- STATUS=$( grep ' Recovery is complete' /var/opt/mssql/log/errorlog* | wc -l)
9
+ /opt/mssql-tools/bin/sqlcmd -t 1 -U sa -P $SA_PASSWORD -Q " select 1" >> /dev/null
10
+ STATUS=$?
10
11
done
11
12
13
+ if [ $STATUS -ne 0 ]; then
14
+ echo " Error: MSSQL SERVER took more than thirty seconds to start up."
15
+ exit 1
16
+ fi
17
+
12
18
echo " ======= MSSQL SERVER STARTED ========" | tee -a ./config.log
13
19
# Run the setup script to create the DB and the schema in the DB
14
20
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SA_PASSWORD -d master -i setup.sql
You can’t perform that action at this time.
0 commit comments