[Feature]: Native DB creation + seeding support
@ascarter 已经在做这个了。
开始于 2026年8月11日。
评估
这个 Issue 还没有评估数据。
描述
Use case
Developers spinning up the Azure SQL Database container locally (via docker run or docker-compose) currently get a bare database instance with no database. Teams using ORMs or migration tools expect the container to create an initial database and optionally seed it with schema/data on first boot — the same experience the official Postgres image provides via POSTGRES_DB and /docker-entrypoint-initdb.d. https://www.postgresql.org/docs/current/app-initdb.html
Current workaround
The only option today is to build and maintain a custom wrapper image on top of the official base image — for example, something that reads a DB_NAME-style env var to create a database on first startup, and mounts a host folder to /docker-entrypoint-initdb.d containing init/seed .sql scripts, with custom logic to track what's already been applied. Which is manageable but it isn't official, isn't documented, so it would be great to have an official image with this approach for the Azure SQL container.
Proposed behavior
- An env var (e.g. MSSQL_DATABASE) to auto-create a database on first boot, mirroring POSTGRES_DB
- Native support for mounting /docker-entrypoint-initdb.d, executing .sql (and ideally .sh) scripts on first startup against an empty data volume
- A defined convention for one-time vs. repeatable scripts, since this Azure SQL Database container doesn't have the same "empty data dir = first boot" simplicity Postgres has, and idempotency would need to be handled explicitly
- A container healthcheck that reflects "seeding complete," not just "engine is up"
Who benefits
All developers
Urgency
Nice to have
Additional context
As a developer, I want the Azure SQL Database container to natively create and seed a database on first run, so that I don't need to hand-roll a custom wrapper image.
As a developer setting up local/CI environments with Azure SQL Database in Docker
I want the container to support an env-var-driven database creation and a native init/seed script mechanism (like Postgres' docker-entrypoint-initdb.d)
So that I can get a ready-to-use, seeded database on first container startup without maintaining custom image tooling
Acceptance Criteria:
- Given MSSQL_DATABASE= is set and no volume-persisted data exists, when the container starts, then a database named is created automatically.
- Given a host folder is mounted to /docker-entrypoint-initdb.d, when the container starts for the first time (empty data volume), then all .sql scripts in that folder are executed against the created database, in a deterministic order.
- Given the container has already been initialized (persisted volume, previously run), when restarted, then init scripts are not re-run automatically.
- Given init scripts are applied, when checking container health, then the healthcheck reflects successful completion of seeding, not just engine availability.
- Given a script fails during initialization, when the container starts, then the failure is surfaced clearly in logs and the container does not report healthy.
- 主要语言
- Shell
- 星标
- 19
- 派生
- 6
- 平均合并
- 4 天 5 小时
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/azure-sql-database-container 的其他 Issue
-
[Bug]: An error occurs when importing bacpac可能重新可做 @ericjulien 于 58 天前认领,目前没有进行中的 PR。 未关闭bug User-filled
microsoft/azure-sql-database-container#140 · 1 条评论 · 已指派 2 人 ·
-
[Feature]: Aspire integration可能重新可做 @vamahtani 于 65 天前认领,目前没有进行中的 PR。 未关闭enhancement needs-triage User-filled
microsoft/azure-sql-database-container#135 · 4 个 reaction · 已指派 1 人 ·
-
[Bug]: Accessing the properties of a database from SSMS returns a "Property SpaceAvailable is not available" error可能重新可做 @ericjulien 于 70 天前认领,目前没有进行中的 PR。 未关闭bug User-filled
microsoft/azure-sql-database-container#134 · 已指派 1 人 ·
-
enhancement User-filled
难度 5/5 一周以上 新手友好度 35/100
microsoft/azure-sql-database-container#133 · 1 条评论 ·
-
[Bug]: changing recovery model en database configuration可能重新可做 @ericjulien 于 70 天前认领,目前没有进行中的 PR。 未关闭bug User-filled
microsoft/azure-sql-database-container#130 · 已指派 1 人 ·
查看 microsoft/azure-sql-database-container 的全部 Issue
相似的 Issue
-
Add dependabot未关闭feat
难度 2/5 1 小时以内 新手友好度 72/100
open-nudge/opentemplate#204 ·
维护者通常 1 天内回复
-
omarchy-brightness-keyboard: double idle-blank saves brightness 0, so wake 'restore' keeps the keyboard backlight off可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
Type/Improvement
难度 2/5 1-3 小时 新手友好度 62/100
wso2/product-integrator-mi#5099 ·
维护者通常 1 天内回复
-
[Bug] Windows 上 pwsh 工具名未按 exec 分类着色,与状态圆点颜色家族分裂可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
ccch1mneyyy/dsh-TUI#1555 ·
维护者通常 1 天内回复
-
Standalone Unix updater reports success when curl fails (`curl | sh` masks the exit status); Windows path is unaffected可能已有人在做 @akhil9tiet 今天认领。 未关闭bug CLI windows-os
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复