SQL Server docker image preloaded with Sakila example database
1.8K
A Microsoft SQL Server Docker image preloaded with the
Sakila sample database (via jOOQ).
One of the sakiladb image family.
These images exist primarily as test fixtures for sq, a
command-line tool for querying SQL databases and structured data — but they are free for anyone to use.
Available on Docker Hub and GitHub Container Registry.
docker run -p 1433:1433 -d sakiladb/sqlserver:latest
The image declares a Docker
HEALTHCHECK, so you can wait for
readiness rather than guessing. SQL Server restores the baked Sakila backup at container start, so its
status becomes healthy after a few seconds, once the database is accepting queries:
docker run -p 1433:1433 -d --name sakila sakiladb/sqlserver:latest
until [ "$(docker inspect -f '{{.State.Health.Status}}' sakila)" = healthy ]; do sleep 1; done
In Docker Compose, gate dependents with depends_on: { condition: service_healthy }.
Tip
Building or testing on GitHub Actions? Pull from GHCR (`ghcr.io/sakiladb/sqlserver`). Docker Hub rate-limits pulls and CI runners share IP addresses, so the limit is reached quickly; GHCR isn't throttled the same way, especially from within GitHub's network.
| Setting | Value |
|---|---|
| host | localhost |
| port | 1433 |
| database | sakila |
| user | sakila |
| password | p_ssW0rd |
With sqlcmd:
$ sqlcmd -S localhost -U sakila -P p_ssW0rd -d sakila -Q 'SELECT TOP 5 actor_id, first_name, last_name FROM actor'
$ sq add 'sqlserver://sakila:p_ssW0rd@localhost:1433?database=sakila' --handle @sakila_ms
$ sq '@sakila_ms.actor | .[0:5]'
The standard Sakila sample database — 16 tables and 7 views, all owned by the sakila user.
sq inspect reports 16 tables and 7 views, the same object set as
every other sakiladb variant.
| Tables (16) | Views (7) |
|---|---|
| actor, address, category, city, country, customer, film, film_actor, film_category, film_text, inventory, language, payment, rental, staff, store | actor_info, customer_list, film_list, nicer_but_slower_film_list, sales_by_film_category, sales_by_store, staff_list |
film_text is a populated table with working full-text search, added as a SQL Server full-text
index under the table (so the column set stays identical to every other variant):
SELECT title FROM film_text WHERE CONTAINS((title, description), 'astronaut');
Every sakiladb variant exposes the same Sakila fixture — the same 16 tables and 7 views, with the
same data — so sq can assert a uniform schema across all of them.
A couple of SQL Server representation details:
CONTAINS(...) (the SQL Server analogue of postgres @@ / MySQL
MATCH … AGAINST). The index sits under the plain film_text table, invisible to the schema.healthy — wait on the HEALTHCHECK rather than connecting immediately.Each SQL Server version is published as its own image tag. latest tracks the newest version
(currently 2022).
| SQL Server | sakiladb Release | Architecture | Docker Hub | GitHub Container Registry |
|---|---|---|---|---|
| 2022 | v2022.0.3 | amd64 | sakiladb/sqlserver:2022, :latest | ghcr.io/sakiladb/sqlserver:2022, :latest |
| 2019 | v2019.0.5 | amd64 | sakiladb/sqlserver:2019 | ghcr.io/sakiladb/sqlserver:2019 |
sakiladb Release is the git tag the current image was built from (see
releases). Its version is v{YEAR}.{MINOR}.{PATCH}:
the year tracks the SQL Server version, while minor/patch track sakiladb's own revisions.
SQL Server base images are amd64-only, so these images are amd64-only. Every version is published to
both Docker Hub and
GitHub Container Registry, and signed
with cosign. Each image also carries
SLSA build provenance and an SPDX SBOM attestation
(verify with gh attestation verify).
SQL Server 2017 (
:2017) is retired: its newest base image is on EOL Ubuntu 18.04, which can no longer install the full-text-search package, so it cannot reach full-text parity with the family. The older:2017image remains pullable via its immutablev2017.0.xtags.
Maintainers: releases are tag-driven. Pushing a semver tag vYEAR.0.x builds and publishes that SQL
Server version — the version is derived from the tag, so there are no per-version branches. See
CLAUDE.md for the full, repeatable procedure.
v2022.0.3): published images now carry
SLSA build provenance and an SPDX SBOM
attestation, alongside the existing cosign signature (pushed to Docker Hub and
GHCR as OCI referrers and to GitHub's attestation store; verify with
gh attestation verify). The README is also synced to the Docker Hub
description on release. The Sakila dataset and schema are unchanged.sales_by_store with the canonical Sakila (v2022.0.2, v2019.0.5): dropped a stray
leading store_id column from the view, so it is now store, manager, total_sales, matching the
column set across the rest of the family.v2019.0.4, v2022.0.1). The Sakila data is now byte-identical
to the original MySQL Sakila: restored the Unicode accents stripped from international place names
(e.g. Réunion, Coruña), the real address.phone numbers, and the full address.district column.sakiladb/mysql: film_list now aggregates the cast (was
one row per film-actor); added actor_info and nicer_but_slower_film_list (16 tables + 7 views);
film_text is populated with working full-text search (CONTAINS('astronaut') = 78); customer.active
is BIT (matching staff.active); and customer_list / staff_list use the canonical zip code.HEALTHCHECK. latest now tracks 2022.Content type
Image
Digest
sha256:cdb9118cb…
Size
900.8 MB
Last updated
3 months ago
docker pull sakiladb/sqlserver