-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
121 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# mssql-agent-fts-ha-tools | ||
# Maintainers: Microsoft Corporation (twright-msft on GitHub) | ||
# GitRepo: https://github.com/Microsoft/mssql-docker | ||
|
||
FROM --platform=linux/amd64 ubuntu:22.04 | ||
|
||
# Install Server FTS & HA | ||
RUN apt-get update && \ | ||
export DEBIAN_FRONTEND=noninteractive && \ | ||
apt-get install -y \ | ||
gnupg && \ | ||
apt-get install -y \ | ||
curl \ | ||
locales \ | ||
apt-transport-https && \ | ||
curl https://packages.microsoft.com/keys/microsoft.asc | tee /etc/apt/trusted.gpg.d/microsoft.asc && \ | ||
curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/mssql-server-2022.list | tee /etc/apt/sources.list.d/mssql-server-2022.list && \ | ||
curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list | tee /etc/apt/sources.list.d/mssql-release.list && \ | ||
export DEBIAN_FRONTEND=noninteractive && \ | ||
apt-get update && \ | ||
ACCEPT_EULA=Y apt-get install -y \ | ||
mssql-server \ | ||
mssql-server-ha \ | ||
mssql-server-fts \ | ||
mssql-tools18 \ | ||
unixodbc-dev && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists | ||
|
||
# Copy the config across | ||
RUN mkdir -p /usr/config | ||
COPY 2022/custom /usr/config | ||
|
||
RUN chmod +x /usr/config/entrypoint.sh | ||
RUN chmod +x /usr/config/setup.sh | ||
|
||
WORKDIR /usr/config | ||
|
||
# Run SQL Server process | ||
ENTRYPOINT ["./entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Start the script to create the DB and import the data, start the app | ||
/usr/config/setup.sh & | ||
|
||
# Start the server | ||
/opt/mssql/bin/sqlservr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
# The SQL server won't start by this time, so let's gently wait for it, if it won't start in 120 sec, let's fail anyway. | ||
timeout=$(($(date +%s) + 120)) | ||
until /opt/mssql-tools18/bin/sqlcmd -No -H localhost -U sa -P "$MSSQL_SA_PASSWORD" -Q "select 'hello'" || [[ $(date +%s) -gt $timeout ]]; do | ||
echo 'SQL server is not ready yet, sleeping for 2 seconds...' | ||
sleep 2 | ||
done | ||
|
||
echo "Running initial SQL statements" | ||
|
||
# run the setup script to run initial sql statements | ||
/opt/mssql-tools18/bin/sqlcmd -No -S localhost -U SA -P "$MSSQL_SA_PASSWORD" -d master -i /usr/config/setup.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
EXEC sp_configure 'show advanced options', 1; | ||
RECONFIGURE; | ||
|
||
EXEC sp_configure 'clr strict security', 0; | ||
RECONFIGURE; |