The mcr.microsoft.com/mssql/server:2025-latest image ships system template databases at internal version 984, but SQL Server 2025 expects version 998. On every fresh container start, SQL Server copies the template files and runs 14 upgrade steps (984 → 998) before accepting connections:
Setup step is copying system data file 'C:\templatedata\master.mdf' to '/var/opt/mssql/data/master.mdf'
Database 'master' running the upgrade step from version 984 to version 985.
Database 'master' running the upgrade step from version 985 to version 986.
...
Database 'master' running the upgrade step from version 994 to version 995.
(and so on through 998)
This adds 30+ seconds to every container startup, which is particularly impactful in CI/CD environments where containers are ephemeral and recreated per job. It is worse on older hardware. GitLab CI's default 30-second service health check timeout is not enough, causing jobs to fail before SQL Server is ready.
Expected behavior:
The template databases in /templatedata/ should already be at latest/expected version.
Environment
- Image: mcr.microsoft.com/mssql/server:2025-latest
- SQL Server version: 2025
- Platform: Linux (Ubuntu 24.04)
- Gitlab: run as a service for tests
Workaround:
Get image, run image (to update it) and then use that updated image.
The mcr.microsoft.com/mssql/server:2025-latest image ships system template databases at internal version 984, but SQL Server 2025 expects version 998. On every fresh container start, SQL Server copies the template files and runs 14 upgrade steps (984 → 998) before accepting connections:
This adds 30+ seconds to every container startup, which is particularly impactful in CI/CD environments where containers are ephemeral and recreated per job. It is worse on older hardware. GitLab CI's default 30-second service health check timeout is not enough, causing jobs to fail before SQL Server is ready.
Expected behavior:
The template databases in /templatedata/ should already be at latest/expected version.
Environment
Workaround:
Get image, run image (to update it) and then use that updated image.