passing arg to entrypoint

This commit is contained in:
Hadis-Fard 2017-08-02 09:46:59 -07:00
parent 177656d20c
commit 101eaf2c66
2 changed files with 7 additions and 9 deletions

View file

@ -27,8 +27,6 @@ ARG PHPSQLDIR=/REPO/msphpsql-dev
ENV TEST_PHP_SQL_SERVER sql
ENV TEST_PHP_SQL_UID sa
ENV TEST_PHP_SQL_PWD Password123
ENV SQLSRV_DBNAME msphpsql_sqlsrv
ENV PDOSQLSRV_DBNAME msphpsql_pdosqlsrv
# set locale to utf-8
RUN locale-gen en_US.UTF-8
@ -78,10 +76,10 @@ RUN sed -i -e 's/TARGET_DATABASE/msphpsql_sqlsrv/g' MsSetup.inc
RUN sed -i -e 's/TARGET_USERNAME/'"$TEST_PHP_SQL_UID"'/g' MsSetup.inc
RUN sed -i -e 's/TARGET_PASSWORD/'"$TEST_PHP_SQL_PWD"'/g' MsSetup.inc
WORKDIR $PHPSQLDIR
RUN chmod +x ./entrypoint.sh
CMD /bin/bash ./entrypoint.sh
ENV TEST_PHP_EXECUTABLE /usr/bin/php
WORKDIR $PHPSQLDIR
RUN chmod +x ./entrypoint.sh
CMD /bin/bash ./entrypoint.sh TEST_PHP_SQL_SERVER $TEST_PHP_SQL_UID $TEST_PHP_SQL_PWD
ENV REPORT_EXIT_STATUS 1

View file

@ -1,9 +1,9 @@
set -e
isConnected="/opt/mssql-tools/bin/sqlcmd -S db -U sa -P Password123"
isConnected="/opt/mssql-tools/bin/sqlcmd -S $1 -U $2 -P $3"
until $isConnected; do
>&2 echo "SQL Server is starting up. Running initial db configuration"
>&2 echo "SQL Server is starting up..."
sleep 1
done
>&2 echo "SQL Server is up - starting app"
>&2 echo "SQL Server is up!"