Guest User

Untitled

a guest
Oct 23rd, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. # use MSSQL 2017 image on Ubuntu 16.04
  2. FROM microsoft/mssql-server-linux:2017-latest
  3.  
  4. # create directory within SQL container for database files
  5. RUN mkdir -p /opt/mssql-scripts
  6.  
  7. # copy the database files from host to container
  8. COPY sql/000_create_db.sql /opt/mssql-scripts
  9.  
  10. # set environment variables
  11. ENV MSSQL_SA_PASSWORD=P@ssw0rd
  12. ENV ACCEPT_EULA=Y
  13.  
  14. # run initial scripts
  15. RUN /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'P@ssw0rd' -i /opt/mssql-scripts/000_create_db.sql
  16.  
  17. Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login timeout expired.
  18. Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : TCP Provider: Error code 0x2749.
  19. 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..
  20.  
  21. docker build -t demo .
  22. docker run -p 1433:1433 --name mssql -d demo
  23. docker exec -it mssql "bash"
  24. /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