Valuator
Valuator

Reputation: 3627

Docker mssql container exits immediately when Docker starts, but not when started manually

I have a MSSQL 2017 Docker container created using Docker Compose with this file:

version: "3"
services:
  mssql-server:
    image: mcr.microsoft.com/mssql/server:2017-latest
    environment:
      ACCEPT_EULA: "Y"
      SA_PASSWORD: "*****"
    ports:
      - "2017:1433"
    container_name: test-mssql

Whenever Docker Desktop for Windows starts, the container starts and then immediately exits. The logs only contain 2 lines:

2019-01-18 16:56:43.02 spid6s Always On: The availability replica manager is going offline because SQL Server is shutting down. This is an informational message only. No user action is required.

2019-01-18 16:56:43.05 spid6s SQL Server is terminating in response to a 'stop' request from Service Control Manager. This is an informational message only. No user action is required.

But if I start the container manually by running docker start test-mssql the container starts and stays running like I expect it to.

Upvotes: 1

Views: 1331

Answers (1)

Mayur Kothari
Mayur Kothari

Reputation: 273

This issue related mssql password policy not match, Now try with password like :

  • Must be at least 8 characters long
  • Must contain at least 1 numeric character,
  • 1 lowercase character,
  • 1 uppercase character, and 1 special (nonalphanumeric) character.

Then try to run docker-compose up -d mssql-server

Upvotes: 1

Related Questions