Today we will install #SQLServer from #microsoft on our beloved #linux using a docker image from Microsoft.
This is a super quick and painless way of installing a SQL server instance.
Look at https://learn.microsoft.com/en-us/sql... for mor configuration parameters.
I noticed now that SA_PASWORD is deprecated and is no MSSQL_SA_PASSWORD that’s one of the things I loathe about Microsoft. They keep changing public interfaces instead of doing it right the first time.
#compose.yml file (note that here we explicitly set the license to Developer (check gthe #documentation for your license!
____
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2022-latest
container_name: sqlserver
ports:
"1433:1433"
restart: unless-stopped
environment:
MSSQL_PID: "Developer"
SA_PASSWORD: "${SA_PASSWORD}"
ACCEPT_EULA: "Y"
volumes:
sql_db_1:/var/opt/mssql
volumes:
sql_db_1:
____
run_sql.sh
#!/bin/bash
#The line below can help when azure authenticatio in browser doesn't work automatically
#It will ask you to surf to a url and enter the provided code (this always works)
#az login --use-device-code --only-show-errors
az login --only-show-errors
PASSWORD=$(az keyvault secret show --name $1 --vault-name $2 --query value -o tsv)
SA_PASSWORD="$PASSWORD" docker-compose up -d
____
run.sh
#!/bin/bash
./run_sql.sh your_secretname your_keyvault _name