I'm trying to setup MSSQL at Docker at Windows 10, but for some reason it started shutting down my container
I've been using it like that for months, but now I have no idea what's happening
C:\Users\user\
λ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
C:\Users\user\
λ docker login
Authenticating with existing credentials...
Login Succeeded
C:\Users\user\
λ docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<YourStrong!Passw0rd>123' -p 1433:1433 --name sql -d mcr.microsoft.com/mssql/server:2017-latest
337e5efb35f0bf4b465181a0f8be4851b12f353a3a8710ddf817d2f501e5fea
C:\Users\user\
λ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
347q5effb3cf0 mcr.microsoft.com/mssql/server:2017-latest "/opt/mssql/bin/sqls…" 3 seconds ago Up 2 seconds 0.0.0.0:1433->1433/tcp sql
C:\Users\user\
λ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
347q5effb3cf0 mcr.microsoft.com/mssql/server:2017-latest "/opt/mssql/bin/sqls…" 6 seconds ago Exited (1) 2 seconds ago sql
C:\Users\user\
λ docker start sql
sql
C:\Users\user\
λ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
347q5effb3cf0 mcr.microsoft.com/mssql/server:2017-latest "/opt/mssql/bin/sqls…" 14 seconds ago Up 2 seconds 0.0.0.0:1433->1433/tcp sql
C:\Users\user\
λ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
347q5effb3cf0 mcr.microsoft.com/mssql/server:2017-latest "/opt/mssql/bin/sqls…" 16 seconds ago Exited (1) 1 second ago sql
docker logs sql
shows
The SQL Server End-User License Agreement (EULA) must be accepted before SQL Server can start. The license terms for this product can be downloaded from http://go.microsoft.com/fwlink/?LinkId=746388.
You can accept the EULA by specifying the --accept-eula command line option, setting the ACCEPT_EULA environment variable, or using the mssql-conf tool. The SQL Server End-User License Agreement (EULA) must be accepted before SQL Server can start. The license terms for this product can be downloaded from http://go.microsoft.com/fwlink/?LinkId=746388.
You can accept the EULA by specifying the --accept-eula command line option, setting the ACCEPT_EULA environment variable, or using the mssql-conf tool.
Anybody has an idea what may be wrong?
Why docker container is exited immediately? You're running a shell in a container, but you haven't assigned a terminal: If you're running a container with a shell (like bash ) as the default command, then the container will exit immediately if you haven't attached an interactive terminal.
If there's no terminal attached, then your shell process will exit, and so the container will exit. You can stop this by adding --interactive --tty (or just -it ) to your docker run ... command, which will let you type commands into the shell.
With Docker, you can also run multiple SQL Server Containers on the same host machine.
Persist your data. Your SQL Server configuration changes and database files are persisted in the container even if you restart the container with docker stop and docker start .
When running Linux containers from Windows command line/Powershell, the environmental options (-e) require double quotes
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=<YourStrong!Passw0rd>123" -p 1433:1433 --name sql -d mcr.microsoft.com/mssql/server:2017-latest
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With