Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # use MSSQL 2017 image on Ubuntu 16.04
- FROM microsoft/mssql-server-linux:2017-latest
- # create directory within SQL container for database files
- RUN mkdir -p /opt/mssql-scripts
- # copy the database files from host to container
- COPY sql/000_create_db.sql /opt/mssql-scripts
- # set environment variables
- ENV MSSQL_SA_PASSWORD=P@ssw0rd
- ENV ACCEPT_EULA=Y
- # run initial scripts
- RUN /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'P@ssw0rd' -i /opt/mssql-scripts/000_create_db.sql
- Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login timeout expired.
- Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : TCP Provider: Error code 0x2749.
- Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
- docker build -t demo .
- docker run -p 1433:1433 --name mssql -d demo
- docker exec -it mssql "bash"
- /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'P@ssw0rd' -i /opt/mssql-scripts/000_create_db.sql
Add Comment
Please, Sign In to add comment