To run some local tests, I needed a database. I didn’t want to spend my time installing a local SQL Server (Express) instance.
So Docker to the rescue! Using SQL Server Express is easy thanks to the mssql-server-linux image.
To create an instance:
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Passw0rd!123" -e "MSSQL_PID=Express" -p 1433:1433 -d --name=sqlexpress microsoft/mssql-server-linux:latest
And if you want to save the data when the container is shutdown, you can create an instance using a mounted volume:
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Passw0rd!123" -e "MSSQL_PID=Express" -p 1433:1433 -d --name=sqlexpress -v //d/data/sql:/var/opt/mssql/data microsoft/mssql-server-linux:latest
Can’t imagine my life anymore without Docker…