Microsoft SQL Server Docker file with auto database creation and .sql script import
1.0K
https://hub.docker.com/r/kkarczmarczyk/mssql/
Microsoft SQL Server docker image with .sql startup file, based on official microsoft/mssql-server image
Dockerfile linkslatest (latest/Dockerfile) - the latest CU of the latest GA releaseSA_PASSWORD (optional) - is the database system administrator (userid = 'sa') password used to connect to SQL Server once the container is running. Important note: This password needs to include at least 8 characters of at least three of these four categories: uppercase letters, lowercase letters, numbers and non-alphanumeric symbols. (Default: SuperSecret!)
MSSQL_DB database name (will be created at startup)
MSSQL_USER username for MSSQL_DB
MSSQL_PASSWORD password for MSSQL_USER
MSSQL_PID (optional) - is the Product ID (PID) or Edition that the container will run with. Acceptable values:
You can execute additional .sql file for database from outside of container at database startup. This container exposes volume /usr/sql - if you link this volume with local folder which contains query.sql file, queries inside file will be executed.
This is an example docker-compose.yaml file:
version: '2'
services:
mssqldev:
container_name: mssqldev
image: kkarczmarczyk/mssql
ports:
- "1433:1433"
environment:
MSSQL_DB: devdb
MSSQL_USER: dev
MSSQL_PASSWORD: randompassword
volumes:
- ./{folder with query.sql file}:/usr/sql
This image is inspired by:
Note: By using this container, you accept SQL Server EULA. Go to https://hub.docker.com/r/microsoft/mssql-server/ for more details.
Content type
Image
Digest
Size
467.9 MB
Last updated
almost 7 years ago
docker pull kkarczmarczyk/mssql