I am begrudgingly performing the soul-draining task of trying to use Microsoft SQL Server in a docker container, and am using the mssql-server-linux box provided by Microsoft. But no matter what I do I cannot login.
Here is my docker-compose.yml file:
version: '2'
services:
db:
build:
context: ./docker/db
environment:
ACCEPT_EULA: "Y"
SA_PASSWORD: "My@Super@Secret"
expose:
- 1433
Here is my Dockerfile:
FROM microsoft/mssql-server-linux
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY startup.sh setup.sql ./
CMD /bin/bash ./startup.sh
Here is my startup.sh:
/opt/mssql/bin/sqlservr & /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "My@Super@Secret" -d master -i setup.sql
Here is my setup.sql:
CREATE DATABASE DemoData;
Every attempt to bring up the container with this entrypoint results in this error:
SQL Server is now ready for client connections. This is an informational message; no user action is required.
2017-09-27 17:30:00.85 spid10s Polybase feature disabled.
2017-09-27 17:30:00.85 spid10s Clearing tempdb database.
2017-09-27 17:30:01.09 Logon Error: 18456, Severity: 14, State: 7.
2017-09-27 17:30:01.09 Logon Login failed for user 'sa'. Reason: An error occurred while evaluating the password. [CLIENT: 172.19.0.2]
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login failed for user 'sa'..
db_1 | Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : TCP Provider: Error code 0x2749.
db_1 | 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..
Obviously removing the entrypoint, going in with /bin/bash and running the command or an attempt to connect command manually produces the same result. I have tried a variety of different password.
I hate Microsoft... Thanks in advance!