Microsoft SQL Server on 25.10.2.1 - Goldeye

I’m trying to get MS SQL Server running on TrueNAS and I’ve tried everything short of creating a VM. I’ve settled on the following YAML:

**services:
sql-server-db:
container_name: sql2025a
environment:
ACCEPT_EULA: ‘Y’
SA_PASSWORD: sql.413516A
UID: 568
image: path to the MS image (this gets downloaded with no issue, it is based on Ubuntu)
ports:

  • ‘1433:1433’
    volumes:
  • /mnt/Mainpool/sqlroot:/var/opt/mssql:rw**

This gives the error:

This container is running as user mssql.

/opt/mssql/bin/sqlservr: Error: The system directory [/.system] could not be created. File: /mnt/vss/_work/1/s/sqlpal/Hosts/Linux/LinuxDirectory.cpp:420 [Status: 0xC0000022 Access denied errno = 0xD(13) Permission denied]

So it looks like it doesn’t have permissions on the ix volume that I’m assuming gets created to hold the root volume of the image. Is there an easy fix, since I’m guessing that my YAML has something missing?

This worked for me (don’t tried yet 2025, only 2019 and 2022)

services:
  sqlserver:
    container_name: mssqlserver
    environment:
      ACCEPT_EULA: 'Y'
      SA_PASSWORD: **change me***
    image: mcr.microsoft.com/mssql/server:2022-latest

    ports:
      - '1533:1433' #i have 2 instances
    restart: unless-stopped
    volumes:
      - /mnt/.../MSSQL2:/var/opt/mssql
version: '3.8'

(Nothing fancy ACL side)

IMHO Is a good way to work fast on dbs, considering that installing an instance directly on MS require more time… I use often a container to test potentislly destructive query

Thanks for your help. It ended up being an issue with my processor, which has both efficiency and performance cores. I had to use this at the start of the YAML to restrict it to a single core type:

**services:
sql2025:
container_name: sql2025
cpuset: 0-3
deploy:
resources:
reservations:
cpus: 4
environment:
ACCEPT_EULA: ‘Y’
MSSQL_SA_PASSWORD: sql.413516A
image: mcr.microsoft…..server-2025:latest
ports:

  • ‘1434:1433’
    user: root
    volumes:**

…and so on. It works fine with SQL 2017 with all cores, but not on 2022 and 2025 which were the ones I was trying all night!

Didn’t know about that, really good to know! Thanks for share