From 101eaf2c66e11dda701a1a21d0b5acf09b2399ed Mon Sep 17 00:00:00 2001 From: Hadis-Fard Date: Wed, 2 Aug 2017 09:46:59 -0700 Subject: [PATCH] passing arg to entrypoint --- Dockerfile-msphpsql | 10 ++++------ entrypoint.sh | 6 +++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Dockerfile-msphpsql b/Dockerfile-msphpsql index d47b99a2..b38469bc 100644 --- a/Dockerfile-msphpsql +++ b/Dockerfile-msphpsql @@ -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 \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index c11ab9f7..00c0f152 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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!"