microsoft / mssql-docker

Official Microsoft repository for SQL Server in Docker resources

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LDF files are not moved to MSSQL_LOG_DIR

pm7y opened this issue · comments

I am overriding the data and log folders using MSSQL_DATA_DIR and MSSQL_LOG_DIR but the *.ldf files are still created in the data dir. The only thing in MSSQL_LOG_DIR are error log files.

According to this link MSSQL_LOG_DIR should move the *.ldf files and MSSQL_ERROR_LOG_FILE should move the log files.

image

Expectation

The *.ldf files are located in the folder specified in MSSQL_LOG_DIR.

version: "3"

name: scratch-dbs

services:
  mssql:
    image: mcr.microsoft.com/mssql/server:2022-CU12-ubuntu-22.04
    user: root
    restart: no
    hostname: scratch-mssql
    environment:
      - ACCEPT_EULA=Y
      - MSSQL_SA_PASSWORD=Scr4tch!
      - MSSQL_PID=Developer
      - MSSQL_BACKUP_DIR=/var/opt/mssql/backups
      - MSSQL_DATA_DIR=/var/opt/mssql/data
      - MSSQL_LOG_DIR=/var/opt/mssql/log

    ports:
      - 14330:1433
    volumes:
      - ./data/mssql/backups:/var/opt/mssql/backups
      - ./data/mssql/data:/var/opt/mssql/data
      - ./data/mssql/log:/var/opt/mssql/log

volumes:
  mssql:

networks:
  default:
    name: scratch-dbs-net