Skip to content

Commit 3c5b3f6

Browse files
authored
Added implicit trust for local loopback sqlcmd (#13)
1 parent 4c4bf8c commit 3c5b3f6

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

shared/backup.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ BACKUP_FILE="${BACKUP_TARGET}/${DATABASE_TARGET}_$(date +%Y%m%d_%H%M%S).bak"
1616

1717
# Perform Database Backup
1818
echo "Initating backup of database [${DATABASE_TARGET}] to ${BACKUP_FILE}"
19-
/opt/mssql-tools/bin/sqlcmd \
20-
-S localhost -U sa \
19+
sqlcmd \
20+
-S localhost -U sa -C \
2121
-Q "BACKUP DATABASE [${DATABASE_TARGET}] TO DISK = N'${BACKUP_FILE}' WITH NOFORMAT, NOINIT, NAME = '${DATABASE_TARGET}-full', SKIP, NOREWIND, NOUNLOAD, STATS = 10"
2222

2323
chmod 640 "${BACKUP_FILE}"

shared/docker-entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ if [ ! -f "${MSSQL_BASE}/.docker-init-complete" ]; then
110110

111111
# Wait up to 60 seconds for database initialization to complete
112112
for ((i=${MSSQL_STARTUP_DELAY:=60};i>0;i--)); do
113-
if /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -l 1 -t 1 -b -Q "SELECT 1" &> /dev/null; then
113+
if sqlcmd -S localhost -U sa -l 1 -t 1 -b -C -Q "SELECT 1" &> /dev/null; then
114114
break
115115
fi
116116
sleep 1
@@ -121,7 +121,7 @@ if [ ! -f "${MSSQL_BASE}/.docker-init-complete" ]; then
121121
fi
122122

123123
# Set SQLCMD command string for additional initialization file processing
124-
sqlcmd=( sqlcmd -S localhost -U sa -l 3 -V 16 )
124+
sqlcmd=( sqlcmd -S localhost -U sa -l 3 -V 16 -C )
125125

126126
echo
127127
for f in /docker-entrypoint-initdb.d/*.bak /docker-entrypoint-initdb.d/*.sh /docker-entrypoint-initdb.d/*.sql; do

0 commit comments

Comments
 (0)