Docker Compose Provisioner
Published 30 June 2026
- Status: Preview
Note: This provisioner was previously named
docker. The newdockerprovisioner is auto-detecting and requires minimal configuration; usedocker-composewhen you need full control over the container via a compose file. To migrate, changeprovisioner = "docker"toprovisioner = "docker-compose"and rename the[environments.<name>.resolvers.docker]section to[environments.<name>.resolvers.docker-compose].Deprecation: A
dockerprovisioner set up with only compose-file keys (composeFile,services) still works. Flyway forwards it todocker-composeand logs a warning on each run. This forwarding will be removed in a future release, so switch the provisioner todocker-compose.Do not mix compose-file keys with the smart Docker keys (
sourceEnvironment,databaseEngine,databaseEngineVersion,keepAlive,iAgreeToTheDBVendorsEula) in onedockersection. That combination is unsupported and fails with an error.
This provisioner allows for the provisioning and re-provisioning of databases using Docker, specifically leveraging the Docker compose functionality
Prerequisites:
- Either create or use an existing Docker compose file, which defines one or more services which will provision a database
To configure this provisioner:
- Set the value of the provisioner parameter to
docker-compose - Populate the following resolver properties:
composeFile- (Required) The Docker compose file to useservices- (Required) The relevant services exposed by the Docker compose filewaitTimeout- (Required) The Docker wait timeout. This takes the form of a number optionally followed by a time unit,s,m,h, ord. If no time unit is specified, seconds are assumed.
Example
This can be used in the TOML configuration like this:
[environments.development]
url = "jdbc:sqlserver://localhost:1433;databaseName=MyDatabase;trustServerCertificate=true"
user = "MyUser"
password = "${localSecret.MyPasswordKey}"
provisioner = "docker-compose"
[environments.development.resolvers.docker-compose]
composeFile = "compose.yml"
services = [ "development" ]
waitTimeout = "1m"
This example is referencing a docker compose file which might look something like this (note that this example is not production ready - it is functional but has plain text passwords):
services:
development:
build: .
environment:
- MSSQL_PASSWORD=MyPassword
- ACCEPT_EULA=Y
ports:
- "1433:1433"
healthcheck:
test: [ "CMD", "/opt/mssql-tools/bin/sqlcmd", "-U", "MyUser", "-P", "MyPassword", "-d", "MyDatabase", "-Q", "SELECT 1"]
interval: 10s
retries: 20
The build step is here being controlled by a Dockerfile:
FROM mcr.microsoft.com/mssql/server:2022-latest
COPY entrypoint.sh entrypoint.sh
ENTRYPOINT [ "/bin/bash", "entrypoint.sh" ]
The bash script in this example (note that this example is not production ready - it is functional but not particularly robust):
#!/bin/bash
/opt/mssql/bin/sqlservr &
for _ in {1..25}; do /opt/mssql-tools/bin/sqlcmd -S localhost -U MyUser -P "$MSSQL_PASSWORD" -q "CREATE DATABASE MyDatabase" && break || (echo "DB not up yet ..." && sleep 15); done
while true; do sleep 1000; done
This documentation contains proprietary information and is protected by copyright law.
Copyright © 2026 Red Gate Software Limited. All rights reserved