DBXDBX

Database Test Lab

Start reproducible, local database instances for DBX development and verification.

The Database Test Lab provides small, pinned Docker Compose environments for testing DBX against real database versions. Every recipe uses a named data volume, a health check, initialization data or smoke data created during verification, and listens on 127.0.0.1 by default.

The default password is 123456, but ports are accessible only from the local host by default. To allow remote access, explicitly set DB_BIND_ADDRESS=0.0.0.0, change DB_PASSWORD, and apply your normal firewall controls. These environments are for development, not production deployment.

Available recipes

DatabaseVersion directoryOfficial Docker Hub imageCNB image used by ComposeDefault host portContainer name
ClickHouseclickhouse/24.8clickhouse/clickhouse-server:24.8.14.39docker.cnb.cool/znb/images/clickhouse-server:24.8.14.398124dbx-clickhouse-24.8
MariaDBmariadb/10.11mariadb:10.11.11docker.cnb.cool/znb/images/mariadb:10.11.113307dbx-mariadb-10.11
MongoDBmongodb/5.0mongo:5.0.5docker.cnb.cool/znb/images/mongo:5.0.527018dbx-mongodb-5.0
MongoDBmongodb/8.2mongo:8.2.3-nobledocker.cnb.cool/znb/images/mongo:8.2.3-noble27018dbx-mongodb-8.2
MySQLmysql/5.7mysql:5.7.44docker.cnb.cool/znb/images/mysql:5.7.443307dbx-mysql-5.7
MySQLmysql/8.4mysql:8.4.6docker.cnb.cool/znb/images/mysql:8.4.63307dbx-mysql-8.4
PostgreSQLpostgresql/14.23postgres:14.23docker.cnb.cool/znb/images/postgres:14.235433dbx-postgresql-14.23
PostgreSQLpostgresql/17.4postgres:17.4docker.cnb.cool/znb/images/postgres:17.45433dbx-postgresql-17.4
Redisredis/3.0.7redis:3.0.7-alpinedocker.cnb.cool/znb/images/redis:3.0.7-alpine6380dbx-redis-3.0.7
Redisredis/7.4redis:7.4.9-alpinedocker.cnb.cool/znb/images/redis:7.4.9-alpine6380dbx-redis-7.4

Every network recipe uses a host port one greater than the database standard port, and the recipe validator enforces that contract. The default password is 123456, and the default database is dbx. Redis has no named databases, so it uses DB 0 with a dbx: smoke-key prefix. Compose uses the CNB image column; the Docker Hub column preserves the official upstream reference for provenance and direct pulls. Redis 3.0.7 is amd64-only; on arm64 hosts the command prints an architecture warning and Docker uses emulation. Every other recipe supports both amd64 and arm64.

Redis 3.0.7 and Redis 7.4.9 intentionally cover the compatibility endpoints. Redis 3 predates ACLs, RESP3, Streams, and many modern commands, while Redis 7 covers the current protocol and command set. Keeping 6.2 and 7.4 together would provide less compatibility coverage for this lab.

Versions of the same product intentionally share that default host port. Start them one at a time, or give one version another port when comparing versions concurrently:

DB_PORT=13307 make db DB=mysql@5.7
make db DB=mysql@8.4

Start and verify an environment

Run commands from the repository root. List the available recipes, then choose a database and version:

make db
make db-list
make db DB=postgresql@17.4
make db-verify DB=postgresql@17.4

make db without parameters prints every currently supported copy-and-paste start command, plus optional parameters. With DB=product@version, it waits for the Compose health check and prints the DBX connection fields. db-verify also runs the recipe's smoke command inside the database container and checks its expected output. It is the preferred command before reporting a database-specific fix.

Commands and variables

Make targetPurpose
make db-listList database versions, images, and supported platforms
make db DB=product@versionCreate, wait for, and print the connection fields
make db-verify DB=product@versionStart and run smoke checks
make db-down DB=product@versionStop the environment while keeping its data volume
make db-reset DB=product@version CONFIRM=1Delete the environment and its data volume
make db-checkValidate every recipe and Compose file

DB_BIND_ADDRESS changes the host-side bind address, DB_PORT changes the host-side port, and DB_PASSWORD changes the default password. For example:

DB_PORT=13306 DB_PASSWORD=local-secret make db-verify DB=mysql@8.4

Remote access must be enabled explicitly:

DB_BIND_ADDRESS=0.0.0.0 DB_PASSWORD=local-secret make db DB=mysql@8.4

db-reset is intentionally guarded: it will not remove a named volume unless CONFIRM=1 is set. Redis has no image initialization-directory convention; its init/README.md documents the smoke key created and read by verify. The lower-level info, status, logs, and shell commands remain available as pnpm db:env -- <command> <product> <version> when needed for diagnosis.

Tab completion

The repository includes dynamic completion for Make targets and DB=product@version values. It reads the current recipe directories, so newly added versions appear without editing the completion scripts.

# Bash
source deploy/database/completion/dbx-make.bash

# Zsh
autoload -Uz compinit && compinit
source deploy/database/completion/_dbx-make.zsh

# PowerShell
. .\deploy\database\completion\Dbx.Make.ps1

Run make db-completion to print these commands. After sourcing the appropriate file, press Tab after make db DB= to select a recipe. The Make targets themselves avoid POSIX-shell conditionals, so they work with GNU Make in PowerShell, Git Bash, or WSL; Docker Desktop and Node.js/pnpm must be available.

Add a recipe

Add a directory under deploy/database/<product>/<version>/ containing:

recipe.json
compose.yaml
init/

recipe.json supplies the DBX connection fields and smoke command array. Do not use a shell string for smoke checks: commands execute as argument arrays. Compose files must pin an image, use a named volume and health check, default port bindings to ${DB_BIND_ADDRESS:-127.0.0.1}, and set container_name to dbx-<product>-<version>.

Finish by running:

pnpm test:db-env
make db-check

On this page