### Copy Environment Example Source: https://github.com/microsoft/mssql-docker/blob/master/linux/samples/Parameterized SQL Server Docker Image/Readme.md Copies the example environment file to a new file for customization. Edit the new .env file with your preferences. ```bash cp .env.example .env ``` -------------------------------- ### Full Example with Database Attachment Source: https://github.com/microsoft/mssql-docker/blob/master/windows/mssql-server-windows/readme.md This example demonstrates running the SQL Server container with all parameters, including port mapping, volume mounting, SA password, EULA acceptance, and attaching a sample database. ```bash docker run -d -p 1433:1433 -v C:/temp/:C:/temp/ -e sa_password= -e ACCEPT_EULA=Y -e attach_dbs="[{'dbName':'SampleDB','dbFiles':['C:\\temp\\sampledb.mdf','C:\\temp\\sampledb_log. ldf']}]" microsoft/mssql-server-windows ``` -------------------------------- ### Example .env File Configuration Source: https://github.com/microsoft/mssql-docker/blob/master/linux/samples/Parameterized SQL Server Docker Image/Readme.md This example .env file configures the build to create a custom container image with SQL Server 2022, including the database engine and Full-Text Search, for Ubuntu 22.04. ```env # Build params UBUNTU_VERSION=22.04 REPO_DISTRO=ubuntu REPO_DISTRO_VERSION=22.04 MSSQL_REPO_FLAVOR=mssql-server-2022 INSTALL_HA=false INSTALL_FTS=true ``` -------------------------------- ### Deploy SQL Server on Kubernetes with Helm Source: https://context7.com/microsoft/mssql-docker/llms.txt Steps to clone the repository, install the Helm chart, and verify the deployment status. ```bash # Clone the repository and navigate to helm chart git clone https://github.com/Microsoft/mssql-docker.git cd mssql-docker/linux/sample-helm-chart # Install SQL Server with default configuration helm install mssql-latest-deploy . \ --set ACCEPT_EULA.value=Y \ --set MSSQL_PID.value=Developer # Verify deployment kubectl get all # Expected output: # NAME READY STATUS RESTARTS AGE # pod/mssql-latest-deploy-645c4dddd8-647zk 1/1 Running 0 1m # # NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE # service/mssql-latest-deploy LoadBalancer 10.0.57.19 20.44.43.212 1433:30544/TCP 1m # Connect using the External IP sqlcmd -S 20.44.43.212 -U sa -P "YourStrong@Passw0rd" ``` -------------------------------- ### Install SQL Server Helm Chart Source: https://github.com/microsoft/mssql-docker/blob/master/linux/sample-helm-chart-statefulset-deployment/readme.md Use this command to install the SQL Server Helm chart. Ensure you accept the EULA and specify the desired SQL Server edition. ```bash helm install mssql . --set ACCEPT_EULA.value=Y --set MSSQL_PID.value=Developer ``` -------------------------------- ### Deploy SQL Server Chart Source: https://github.com/microsoft/mssql-docker/blob/master/linux/rancher/readme.md Install the Helm chart into a new namespace using the provided values file. ```bash helm install --create-namespace -n sql-server -f values.example.yaml . ``` -------------------------------- ### Deploy SQL Server with Helm Source: https://github.com/microsoft/mssql-docker/blob/master/linux/sample-helm-chart/readme.md Command to install the SQL Server Helm chart with EULA acceptance and product ID configuration. ```bash helm install mssql-latest-deploy . --set ACCEPT_EULA.value=Y --set MSSQL_PID.value=Developer ``` -------------------------------- ### Check Deployed Resources Source: https://github.com/microsoft/mssql-docker/blob/master/linux/sample-helm-chart-statefulset-deployment/readme.md After installation, use this command to verify that all SQL Server pods and services have been deployed successfully. ```bash D:\helm-charts\sql-statefull-deploy>kubectl get all ``` -------------------------------- ### Run SQL Server on Windows Containers Source: https://context7.com/microsoft/mssql-docker/llms.txt Commands to deploy SQL Server Developer edition on Windows, including an example for attaching existing database files. ```bash # Run SQL Server Developer on Windows with volume mount docker run -d -p 1433:1433 \ -v C:/temp/:C:/temp/ \ -e sa_password=YourStrong@Passw0rd \ -e ACCEPT_EULA=Y \ microsoft/mssql-server-windows-developer # Run with database attachment configuration docker run -d -p 1433:1433 \ -v C:/temp/:C:/temp/ \ -e sa_password=YourStrong@Passw0rd \ -e ACCEPT_EULA=Y \ -e attach_dbs="[{'dbName':'SampleDB','dbFiles':['C:\\temp\\sampledb.mdf','C:\\temp\\sampledb_log.ldf']}]" \ microsoft/mssql-server-windows-developer ``` -------------------------------- ### Configure SQL Server Container with Environment Variables Source: https://context7.com/microsoft/mssql-docker/llms.txt This example shows how to run a SQL Server container using various environment variables to configure edition, agent, collation, memory, and port mapping. It also includes volume mounting for persistent data. ```bash # Example with all common options docker run -d \ -e "ACCEPT_EULA=Y" \ -e "SA_PASSWORD=YourStrong@Passw0rd" \ -e "MSSQL_PID=Developer" \ -e "MSSQL_AGENT_ENABLED=true" \ -e "MSSQL_COLLATION=SQL_Latin1_General_CP1_CI_AS" \ -e "MSSQL_MEMORY_LIMIT_MB=4096" \ -p 1433:1433 \ -v sqldata:/var/opt/mssql \ --name sql-server \ mcr.microsoft.com/mssql/server:2019-latest ``` -------------------------------- ### Configure SQL Server Helm Chart Source: https://context7.com/microsoft/mssql-docker/llms.txt Example values.yaml file for customizing SQL Server deployment settings such as edition, storage, and resource limits. ```yaml # values.yaml - Key configuration options replicas: 1 image: repository: mcr.microsoft.com/mssql/server pullPolicy: IfNotPresent tag: "2019-latest" ACCEPT_EULA: value: "Y" MSSQL_PID: value: "Developer" # Options: Developer, Express, Standard, Enterprise, EnterpriseCore MSSQL_AGENT_ENABLED: value: "true" hostname: mssqllatest sa_password: "YourStrong@Passw0rd" containers: ports: containerPort: 1433 service: type: LoadBalancer port: 1433 pvc: StorageClass: "azure-disk" userdbaccessMode: ReadWriteOnce userdbsize: 5Gi userlogaccessMode: ReadWriteOnce userlogsize: 5Gi tempdbaccessMode: ReadWriteOnce tempsize: 2Gi mssqldataaccessMode: ReadWriteOnce mssqldbsize: 2Gi ``` -------------------------------- ### Run SQL Server Express Container with Attached Database Source: https://github.com/microsoft/mssql-docker/blob/master/windows/mssql-server-windows-express/readme.md This example demonstrates running the SQL Server Express container with all parameters, including attaching a sample database. Ensure the database files are accessible within the container. ```bash docker run -d -p 1433:1433 -v C:/temp/:C:/temp/ -e sa_password= -e ACCEPT_EULA=Y -e attach_dbs="[{'dbName':'SampleDB','dbFiles':['C:\\temp\\sampledb.mdf','C:\\temp\\sampledb_log. ldf']}]" microsoft/mssql-server-windows-express ``` -------------------------------- ### Kubernetes Resource Status Output Source: https://github.com/microsoft/mssql-docker/blob/master/linux/sample-helm-chart/readme.md Example output showing the status of pods, services, deployments, and replicasets after deployment. ```text NAME READY STATUS RESTARTS AGE pod/mssql-latest-deploy-645c4dddd8-647zk 1/1 Running 4 23h NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/kubernetes ClusterIP 10.0.0.1 443/TCP 140d service/mssql-latest-deploy LoadBalancer 10.0.57.19 20.44.43.212 1433:30544/TCP 23h NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/mssql-latest-deploy 1/1 1 1 23h NAME DESIRED CURRENT READY AGE replicaset.apps/mssql-latest-deploy-645c4dddd8 1 1 1 23h ``` -------------------------------- ### Run SQL Server Developer Edition Container Source: https://github.com/microsoft/mssql-docker/blob/master/windows/mssql-server-windows-developer/readme.md Starts a SQL Server container with port mapping, volume mounting, and required environment variables. ```bash docker run -d -p 1433:1433 -v C:/temp/:C:/temp/ -e sa_password= -e ACCEPT_EULA=Y -e attach_dbs="" microsoft/mssql-server-windows-developer ``` -------------------------------- ### Python pyodbc SQL Server Connection Example Source: https://context7.com/microsoft/mssql-docker/llms.txt Sample Python script demonstrating how to connect to SQL Server using the pyodbc driver, query the version, and list databases. Assumes connection details are provided. ```python import pyodbc server = '192.168.1.100' username = 'sa' password = 'YourStrong@Passw0rd' cnxn = pyodbc.connect( 'DRIVER={ODBC Driver 18 for SQL Server};' f'SERVER={server};PORT=1433;' f'UID={username};PWD={password};' 'TrustServerCertificate=yes' ) cursor = cnxn.cursor() print('Using the following SQL Server version:') tsql = "SELECT @@version;" cursor.execute(tsql) row = cursor.fetchone() print(str(row[0])) # Query example cursor.execute("SELECT name, database_id FROM sys.databases") for row in cursor.fetchall(): print(f"Database: {row[0]}, ID: {row[1]}") cnxn.close() ``` -------------------------------- ### Connect to SQL Server with PHP Source: https://context7.com/microsoft/mssql-docker/llms.txt This PHP script demonstrates how to connect to a SQL Server instance and execute a query. It uses the sqlsrv functions and requires the SQL Server drivers for PHP to be installed. ```php "master", "Uid" => "sa", "PWD" => "YourStrong@Passw0rd", "TrustServerCertificate" => true ); // Establish connection $conn = sqlsrv_connect($serverName, $connectionOptions); if ($conn) { echo "Connected successfully!\n"; // Execute query $sql = "SELECT @@VERSION AS version"; $stmt = sqlsrv_query($conn, $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_ASSOC)) { echo "SQL Server Version: " . $row['version'] . "\n"; } sqlsrv_free_stmt($stmt); sqlsrv_close($conn); } else { echo "Connection failed!\n"; die(print_r(sqlsrv_errors(), true)); } ?> ``` -------------------------------- ### Connect to SQL Server with Node.js Source: https://context7.com/microsoft/mssql-docker/llms.txt Use this Node.js code to establish a connection to a SQL Server instance running in a Docker container. Ensure the 'tedious' package is installed. ```javascript // Sample Node.js connection code (sample.js) var Connection = require('tedious').Connection; var Request = require('tedious').Request; var config = { server: '192.168.1.100', authentication: { type: 'default', options: { userName: 'sa', password: 'YourStrong@Passw0rd' } }, options: { encrypt: true, trustServerCertificate: true, database: 'master' } }; var connection = new Connection(config); connection.on('connect', function(err) { if (err) { console.log('Connection failed:', err); } else { console.log('Connected to SQL Server'); executeStatement(); } }); connection.connect(); function executeStatement() { var request = new Request("SELECT @@VERSION", function(err, rowCount) { if (err) { console.log('Query error:', err); } else { console.log('Rows returned:', rowCount); } connection.close(); }); request.on('row', function(columns) { columns.forEach(function(column) { console.log('SQL Server Version:', column.value); }); }); connection.execSql(request); } ``` -------------------------------- ### Run Interactive Bash Session Source: https://github.com/microsoft/mssql-docker/blob/master/oss-drivers/msphpsql/README.md Starts an interactive bash session within the container. ```bash docker run -it microsoft/msphpsql ``` -------------------------------- ### Run Interactive Bash Session in Container Source: https://github.com/microsoft/mssql-docker/blob/master/oss-drivers/pyodbc/README.md Use this command to start an interactive bash session within the container. This is useful for exploring the environment or running commands manually. ```bash docker run -it microsoft/pyodbc ``` -------------------------------- ### Rancher Helm Chart Configuration Source: https://context7.com/microsoft/mssql-docker/llms.txt Example `values.yaml` for the Rancher Helm chart, detailing SQL Server PID, EULA acceptance, SQL Agent enablement, image repository and tag, ports, and storage size. ```yaml mssql: pid: Developer conf: eula: accepteula: true accepteulaml: true lcid: 1033 # english sqlagent: enabled: true statefulset: template: spec: containers: sqlServer: image: repository: mcr.microsoft.com/mssql/server pullPolicy: IfNotPresent tag: 2019-latest ports: databaseEngineContainerPort: 1433 service: spec: ports: sqlServerDatabasePort: 1433 storage: size: 8 ``` -------------------------------- ### Run Interactive Bash Session in Container Source: https://github.com/microsoft/mssql-docker/blob/master/oss-drivers/tedious/README.md Execute this command to start an interactive bash session within the container. This is useful for exploring the environment and running commands manually. ```bash docker run -it microsoft/tedious ``` -------------------------------- ### Execute PHP Connection Sample Source: https://github.com/microsoft/mssql-docker/blob/master/oss-drivers/msphpsql/README.md Runs the pre-configured PHP script to test the connection to the SQL Server instance. ```bash php connect.php ``` -------------------------------- ### Connect to SQL Server using Node.js Source: https://github.com/microsoft/mssql-docker/blob/master/oss-drivers/tedious/README.md Run this Node.js script to establish a connection to a SQL Server instance. Ensure the database parameters within the script are correctly configured. ```javascript node connect.js ``` -------------------------------- ### Execute Python SQL Server Connection Sample Source: https://github.com/microsoft/mssql-docker/blob/master/oss-drivers/pyodbc/README.md Run the provided Python script to connect to a SQL Server instance. Ensure the database connection parameters are correctly set within the script or via environment variables. ```bash python connect.py ``` -------------------------------- ### Run PHP Development Container Source: https://context7.com/microsoft/mssql-docker/llms.txt This command launches a pre-built PHP development container with SQL Server drivers. It configures the database host, username, and password using environment variables. ```bash # Run PHP development container docker run -it \ -e DB_HOST=192.168.1.100 \ -e DB_USERNAME=sa \ -e DB_PASSWORD=YourStrong@Passw0rd \ microsoft/msphpsql ``` -------------------------------- ### Connect to SQL Server using sqlcmd Source: https://github.com/microsoft/mssql-docker/blob/master/oss-drivers/pyodbc/README.md Utilize the sqlcmd utility to connect to your SQL Server instance from within the container. Replace placeholders with your actual database host, username, and password. ```bash sqlcmd -S $DB_HOST -U $DB_USERNAME -P $DB_PASSWORD ``` -------------------------------- ### Verify Final Deployment Resources Source: https://github.com/microsoft/mssql-docker/blob/master/linux/sample-helm-chart-statefulset-deployment/readme.md Run this command to confirm that all resources, including pods and services, are running after applying the additional service manifests. ```bash D:>kubectl get all ``` -------------------------------- ### Deploy SQL Server StatefulSet with Helm Source: https://context7.com/microsoft/mssql-docker/llms.txt Deploys three SQL Server instances as a StatefulSet using a Helm chart for high availability. Requires navigating to the chart directory and applying external services. ```bash cd mssql-docker/linux/sample-helm-chart-statefulset-deployment helm install mssql . --set ACCEPT_EULA.value=Y --set MSSQL_PID.value=Developer kubectl apply -f services/ex_service.yaml kubectl apply -f services/ag_endpoint.yaml kubectl get all ``` -------------------------------- ### Deploy SQL Server with Rancher Helm Chart Source: https://context7.com/microsoft/mssql-docker/llms.txt Deploys SQL Server on SUSE Rancher-managed Kubernetes clusters using an optimized Helm chart. Configuration is done via `values.example.yaml`. ```bash cd mssql-docker/linux/rancher helm install --create-namespace -n sql-server -f values.example.yaml . ``` -------------------------------- ### Build SQL Server Docker Image Source: https://github.com/microsoft/mssql-docker/blob/master/windows/mssql-server-windows-developer/readme.md Builds the Docker image with a specified memory limit. ```bash docker build --memory 4g . ``` -------------------------------- ### Verify Kubernetes Deployment Source: https://github.com/microsoft/mssql-docker/blob/master/linux/sample-helm-chart/readme.md Command to list all Kubernetes resources to verify the status of the SQL Server deployment. ```bash D:\helm-charts\mssql-latest\mssql-latest>kubectl get all ``` -------------------------------- ### Run Container with Database Attachment Source: https://github.com/microsoft/mssql-docker/blob/master/windows/mssql-server-windows-developer/readme.md Executes the container with a specific database configuration passed as an environment variable. ```bash docker run -d -p 1433:1433 -v C:/temp/:C:/temp/ -e sa_password= -e ACCEPT_EULA=Y -e attach_dbs="[{'dbName':'SampleDB','dbFiles':['C:\\temp\\sampledb.mdf','C:\\temp\\sampledb_log. ldf']}]" microsoft/mssql-server-windows-developer ``` -------------------------------- ### Run Node.js Tedious Development Container Source: https://context7.com/microsoft/mssql-docker/llms.txt Runs a pre-built Node.js development container with the tedious driver for SQL Server connectivity. Requires setting database connection environment variables. ```bash docker run -it \ -e DB_HOST=192.168.1.100 \ -e DB_USERNAME=sa \ -e DB_PASSWORD=YourStrong@Passw0rd \ microsoft/tedious ``` -------------------------------- ### Run SQL Server Container Source: https://github.com/microsoft/mssql-docker/blob/master/windows/mssql-server-windows/readme.md Use this command to run a SQL Server container. Ensure you have Windows Server 2016 or Windows 10. Mount a host folder for persistent storage and set the SA password and EULA acceptance. ```bash docker run -d -p 1433:1433 -v C:/temp/:C:/temp/ -e sa_password= -e ACCEPT_EULA=Y -e attach_dbs="" microsoft/mssql-server-windows ``` -------------------------------- ### Parameterized SQL Server Docker Build Source: https://context7.com/microsoft/mssql-docker/llms.txt Builds a custom SQL Server Docker image with configurable parameters like Ubuntu version, SQL Server version, and optional components. Uses a `.env` file for configuration. ```bash cat > .env << 'EOF' UBUNTU_VERSION=22.04 REPO_DISTRO=ubuntu REPO_DISTRO_VERSION=22.04 MSSQL_REPO_FLAVOR=mssql-server-2022 INSTALL_HA=false INSTALL_FTS=true EOF docker-compose build --no-cache docker run -d --name sqlfts -p 14305:1433 -h sqlfts \ -e ACCEPT_EULA=Y \ -e MSSQL_SA_PASSWORD=YourStrong@Passw0rd \ sqlserver-fts:latest ``` -------------------------------- ### Build SQL Server Custom Image Source: https://github.com/microsoft/mssql-docker/blob/master/linux/samples/Parameterized SQL Server Docker Image/Readme.md Builds a Docker image tagged as 'sqlserver-custom' using the Dockerfile in the current directory. ```bash docker build -t sqlserver-custom . ``` -------------------------------- ### Build SQL Server Docker Image with Custom Repository Source: https://context7.com/microsoft/mssql-docker/llms.txt Builds a SQL Server Docker image directly using the `docker build` command, allowing specification of a custom repository configuration URL. ```bash docker build \ --build-arg REPO_CONFIG_URL=https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2019.list \ -t custom-sqlserver . ``` -------------------------------- ### Build Custom SQL Server Image with Custom Repository URL Source: https://github.com/microsoft/mssql-docker/blob/master/linux/samples/Parameterized SQL Server Docker Image/Readme.md Builds a custom SQL Server Docker image, overriding the default repository URL construction. This allows specifying a direct URL to a repository configuration list. ```bash docker build --build-arg REPO_CONFIG_URL=https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2019.list -t custom-sqlserver . ``` -------------------------------- ### Build and Deploy SQL Server 2019 with HA Source: https://github.com/microsoft/mssql-docker/blob/master/linux/samples/Parameterized SQL Server Docker Image/Readme.md Builds and deploys a SQL Server 2019 instance with High Availability components enabled. Requires updating the .env file and rebuilding the image before running Docker Compose. ```bash # Update .env: # MSSQL_REPO_FLAVOR=mssql-server-2019 # INSTALL_HA=true docker-compose build --no-cache docker-compose up -d ``` -------------------------------- ### Run Python pyodbc Development Container Source: https://context7.com/microsoft/mssql-docker/llms.txt Runs a pre-built Python development container with the pyodbc driver for SQL Server connectivity. Requires setting database connection environment variables. ```bash docker run -it \ -e DB_HOST=192.168.1.100 \ -e DB_USERNAME=sa \ -e DB_PASSWORD=YourStrong@Passw0rd \ microsoft/pyodbc ``` -------------------------------- ### Manage SQL Server with mssql-tools Source: https://context7.com/microsoft/mssql-docker/llms.txt Commands for using the mssql-tools container to execute queries and perform bulk data copies. ```bash # Run mssql-tools container for interactive session docker run -it mcr.microsoft.com/mssql-tools # Connect to a SQL Server instance using sqlcmd sqlcmd -S 192.168.1.100 -U sa -P "YourStrong@Passw0rd" -Q "SELECT name FROM sys.databases" # Bulk copy data from CSV to SQL Server bcp MyDatabase.dbo.MyTable in /data/import.csv \ -S 192.168.1.100 -U sa -P "YourStrong@Passw0rd" \ -c -t "," -F 2 ``` -------------------------------- ### Navigate to Chart Directory Source: https://github.com/microsoft/mssql-docker/blob/master/linux/rancher/readme.md Change the working directory to the location of the Rancher Helm chart. ```bash cd linux/rancher ``` -------------------------------- ### Run SQL Server on Linux Containers Source: https://context7.com/microsoft/mssql-docker/llms.txt Commands to pull, run, and verify a SQL Server 2019 Linux container, including a connection test using sqlcmd. ```bash # Pull and run SQL Server 2019 on Linux docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=YourStrong@Passw0rd" \ -p 1433:1433 --name sql-server \ -d mcr.microsoft.com/mssql/server:2019-latest # Verify container is running docker ps # Connect using sqlcmd from the container docker exec -it sql-server /opt/mssql-tools/bin/sqlcmd \ -S localhost -U SA -P "YourStrong@Passw0rd" \ -Q "SELECT @@VERSION" ``` -------------------------------- ### Apply External Service and AG Endpoint Manifests Source: https://github.com/microsoft/mssql-docker/blob/master/linux/sample-helm-chart-statefulset-deployment/readme.md Apply these Kubernetes manifests to create an external load balancer service for each pod and a cluster IP service for AG endpoints. ```bash D:\helm-charts\sql-statefull-deploy>kubectl apply -f "D:\helm-charts\sql-statefull-deploy\services\ex_service.yaml" ``` ```bash D:\helm-charts\sql-statefull-deploy>kubectl apply -f "D:\helm-charts\sql-statefull-deploy\services\ag_endpoint.yaml" ``` -------------------------------- ### Run Chart Linting Source: https://github.com/microsoft/mssql-docker/blob/master/linux/rancher/readme.md Validate the Helm chart configuration using the makefile. ```bash make lint ``` -------------------------------- ### Deploy SQL Server with Docker Compose Source: https://github.com/microsoft/mssql-docker/blob/master/linux/samples/Parameterized SQL Server Docker Image/Readme.md Deploys the SQL Server container using Docker Compose in detached mode. This uses the default configuration. ```bash docker-compose up -d ``` -------------------------------- ### Run SQL Server Express Container Source: https://github.com/microsoft/mssql-docker/blob/master/windows/mssql-server-windows-express/readme.md Use this command to run the SQL Server Express container. Ensure you have Windows Server 2016 or Windows 10. Replace with a strong password and with your database configuration. ```bash docker run -d -p 1433:1433 -v C:/temp/:C:/temp/ -e sa_password= -e ACCEPT_EULA=Y -e attach_dbs="" microsoft/mssql-server-windows-express ``` -------------------------------- ### Build Docker Image with Docker Compose Source: https://github.com/microsoft/mssql-docker/blob/master/linux/samples/Parameterized SQL Server Docker Image/Readme.md Builds the Docker image using Docker Compose, ensuring no cache is used. This command is typically run after configuring environment variables. ```bash docker-compose build --no-cache ``` -------------------------------- ### Run Custom SQL Server Container Source: https://github.com/microsoft/mssql-docker/blob/master/linux/samples/Parameterized SQL Server Docker Image/Readme.md Runs a custom SQL Server container named 'sqlserver-container' in detached mode. It maps port 1433, accepts the EULA, sets the SA password, and specifies the 'Developer' edition. ```bash docker run -d \ --name sqlserver-container \ -p 1433:1433 \ -e ACCEPT_EULA=Y \ -e SA_PASSWORD= \ -e MSSQL_PID=Developer \ sqlserver-custom ``` -------------------------------- ### Inspect Container IP Address Source: https://github.com/microsoft/mssql-docker/blob/master/oss-drivers/msphpsql/README.md Retrieves the IP address of a running SQL Server container. ```bash docker inspect ``` -------------------------------- ### Configure Database Attachment JSON Source: https://github.com/microsoft/mssql-docker/blob/master/windows/mssql-server-windows/readme.md This JSON format is used for the `attach_dbs` environment variable to attach custom databases. Note the use of single quotes within the JSON string and double backslashes for escaping file paths. ```json [ { 'dbName': 'MaxDb', 'dbFiles': ['C:\\temp\\maxtest.mdf', 'C:\\temp\\maxtest_log.ldf'] }, { 'dbName': 'PerryDb', 'dbFiles': ['C:\\temp\\perrytest.mdf', 'C:\\temp\\perrytest_log.ldf'] } ] ``` -------------------------------- ### Run SQL Server FTS Container Source: https://github.com/microsoft/mssql-docker/blob/master/linux/samples/Parameterized SQL Server Docker Image/Readme.md Runs a SQL Server container with Full-Text Search enabled in detached mode. It maps port 14305 to the default SQL Server port 1433 and sets the container name to 'sqlfts'. ```bash docker run -d --name sqlfts -p 14305:1433 -h sqlfts -e ACCEPT_EULA=Y -e MSSQL_SA_PASSWORD= sqlserver-fts:latest ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.