Sign inSign up

sakiladb/sqlserver

By sakiladb

Updated 3 months ago

SQL Server docker image preloaded with Sakila example database

Image
Developer tools
Databases & storage
0

1.8K

sakiladb/sqlserver repository overview

sakiladb/sqlserver

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.

Quick start

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.

Connection

SettingValue
hostlocalhost
port1433
databasesakila
usersakila
passwordp_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'

Or with sq (install):

$ sq add 'sqlserver://sakila:p_ssW0rd@localhost:1433?database=sakila' --handle @sakila_ms
$ sq '@sakila_ms.actor | .[0:5]'

What's inside

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, storeactor_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');

Differences from other sakila variants

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:

  • Full-text search uses CONTAINS(...) (the SQL Server analogue of postgres @@ / MySQL MATCH … AGAINST). The index sits under the plain film_text table, invisible to the schema.
  • The data is restored at container start (from a backup baked into the image), so the container takes a few seconds to become healthy — wait on the HEALTHCHECK rather than connecting immediately.

Available versions

Each SQL Server version is published as its own image tag. latest tracks the newest version (currently 2022).

SQL Serversakiladb ReleaseArchitectureDocker HubGitHub Container Registry
2022v2022.0.3amd64sakiladb/sqlserver:2022, :latestghcr.io/sakiladb/sqlserver:2022, :latest
2019v2019.0.5amd64sakiladb/sqlserver:2019ghcr.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 :2017 image remains pullable via its immutable v2017.0.x tags.

Releasing a new version

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.

Changelog

2026-06-30
  • Supply-chain attestations (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.
2026-06-28
  • Aligned 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.
2026-06-26
  • Restored faithful original data (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.
  • Modernized as a consistent sakiladb fixture. Reconciled the schema to the canonical 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.
  • Tag-driven, multi-registry build. Version derived from the git tag, data + full-text index generated at build time, mirrored to GitHub Container Registry, cosign-signed, with a Docker HEALTHCHECK. latest now tracks 2022.
  • SQL Server 2017 retired (its EOL Ubuntu 18.04 base cannot install full-text search).

License

BSD 2-Clause.

Tag summary

Content type

Image

Digest

sha256:cdb9118cb

Size

900.8 MB

Last updated

3 months ago

docker pull sakiladb/sqlserver