Skip to content

upgrade mssql version #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM mcr.microsoft.com/mssql/server:2019-CU22-ubuntu-20.04

FROM mcr.microsoft.com/mssql/server:2022-latest

# Starting with SQL*Server 2017-CU6, by default, flushing became
# more aggresive, in order to guarantee consistency under power
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A Microsoft SQL Server for Linux instance configured for Moodle development. Bas
# Example usage

```bash
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 -d moodlehq/moodle-db-mssql
docker run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 -d moodlehq/moodle-db-mssql
```

# Features:
Expand All @@ -17,7 +17,7 @@ docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=yourStrong(!)Password' -p 1433:143

Requires the following environment flags:
* ACCEPT_EULA=Y
* SA_PASSWORD=<your_strong_password>
* MSSQL_SA_PASSWORD=<your_strong_password>

# See also
This container is part of a set of containers for Moodle development, see also:
Expand Down
2 changes: 1 addition & 1 deletion root/setup-db-for-moodle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ set -e
./wait-for-mssql-to-come-up.sh

echo "[moodle-db-mssql] Setting up Moodle data"
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SA_PASSWORD -d master -i setup.sql
/opt/mssql-tools18/bin/sqlcmd -No -S localhost -U sa -P $MSSQL_SA_PASSWORD -d master -i setup.sql
echo "[moodle-db-mssql] Setup complete."
6 changes: 3 additions & 3 deletions root/wait-for-mssql-to-come-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
set -e

i=0
until /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "$SA_PASSWORD" -d master -l 1 -Q "SELECT 1" > /dev/null 2>&1
until /opt/mssql-tools18/bin/sqlcmd -No -S localhost -U sa -P "$MSSQL_SA_PASSWORD" -d master -l 1 -Q "SELECT 1" > /dev/null 2>&1
do
echo "[moodle-db-mssql] Waiting for SQL to accept connections"
sleep 1
sleep 10

i=$((i+1))
if [ $i -gt 60 ]; then
if [ $i -gt ${MSSQL_WAIT4READY:-60} ]; then
echo "[moodle-db-mssql] timed out waiting for server to accept connections"
exit 1;
fi
Expand Down