What support does Liquibase have for Docker?
Last updated: July 14, 2025
Docker is an open platform for developing, shipping, and running applications. Docker provides the ability to package and run an application in a loosely isolated environment called a container. You can also create and use images, networks, volumes, plugins, and other objects.
Using a virtual machine requires a separate copy of the operating system, which needs space. Docker leverages the host system for the operating system to cut down on space. Additionally, Docker helps you start your application more quickly.
Liquibase Docker container image
Tip: Our Liquibase Docker Official Image is available with Liquibase 4.27.0 and newer. We recommend all users use this image for the latest updates and support. Any versions prior to 4.27.0 are only available on the liquibase/liquibase
community image. This community image will be deprecated in the future. Transitioning to the official image ensures you will continue receiving updates and support.
Liquibase Docker container image includes the Liquibase software, Java, JDBC drivers, and all other dependencies already preconfigured. The image is based on the Eclipse Temurin image eclipse-temurin:17-jre-focal
.
Also, there are libraries represented by database driver and client packages that are preinstalled into the container image:
DB2
Firebird
MariaDB
MS SQL Server
PostgreSQL
Snowflake
SQLite
Sybase
Note: The database drivers for MongoDB Pro and MySQL are not preinstalled into the container image and require additional steps to install. See the MongoDB Pro driver and the MySQL driver.
See the Liquibase Dockerfile for more details.
Docker pull command: docker pull liquibase
Example JDBC URLs
Database | JDBC URL |
IBM DB2 LUW |
|
Microsoft SQL Server |
|
MySQL |
|
MariaDB |
|
PostgreSQL |
|
Snowflake |
|
Sybase |
|
SQLite |
|
Supported tags and image flavors
Tags
The following tags are officially supported:
Overall most recent build: The
latest
tag is kept up to date with the most advanced Liquibase release:latest
.Latest major or minor builds: These tags are kept up to date with the most recent patch release of each stream, such as
4.23
.Specific releases: Each specific release has an associated tag, such as
4.23.1
.
For a full list of tags, see https://hub.docker.com/_/liquibase/tags.
liquibase:
This liquibase:<version>
image is considered the standard choice. If you're uncertain about your specific requirements, it's recommended to opt for this image. It is designed to serve as a disposable container as well as a foundational building block for creating other images.
liquibase:-alpine
The liquibase:<version>-alpine
image is a slimmed-down version of the Liquibase Docker container (liquibase:<version>
). It is designed to be lightweight and have a smaller footprint, making it suitable for environments with limited resources or when only the essential functionality is required. This image is built upon the popular Alpine Linux project, which can be found in the official Alpine image. Alpine Linux stands out for its significantly smaller size compared to other distribution base images, typically around 5MB. As a result, it enables the creation of overall slimmer images.
If your main concern is minimizing the final image size, this flavor proves to be quite useful. However, it is important to note that certain software may encounter issues depending on its specific libc
requirements or assumptions.
To keep the image size to a minimum, additional tools such as git
or bash
are not commonly included in Alpine-based images. Instead, you can utilize this image as a foundation and add the necessary components in your own Dockerfile. For more information, see create a custom Docker image.
Changelog files
The docker image has a /liquibase/changelog
volume in which the directory that contains the root of your changelog tree can be mounted. Your --changelog-file
attribute should include the path relative to the volume.
You can also use the /liquibase/changelog
volume for commands that create output files, such as generate-changelog
. In this case, you must specify the absolute path to the changelog; prefix the path with /liquibase/changelog/<PATH TO CHANGELOG FILE>
.
Example
If you have a local /path/to/changelog:/liquibase/changelog liquibase/changelog.xml
file, you can run:
docker run --rm -v /path/to/changelog:/liquibase/changelog liquibase/liquibase --changeLogFile=changelog.xml update
To generate a new changelog file at this location, run:
docker run --rm -v /path/to/changelog:/liquibase/changelog liquibase/liquibase liquibase generate-changelog
Configuration files
If you use a Liquibase properties file (defaults file) like liquibase.properties
to specify attributes instead of passing them on the command line, include it in your changelog volume mount and reference it when running commands.
When you specify a custom Liquibase properties file, ensure you include the relative file path to the /liquibase/liquibase.properties
volume so that Liquibase can continue looking for your properties file there.
Example
If you have a local /path/to/liquibase.properties:/liquibase/liquibase.properties liquibase/liquibase.properties
file, where liquibase.properties
represents the Liquibase properties file, run the following command:
docker run --rm -v /path/to/liquibase.properties:/liquibase/liquibase.properties/liquibase --defaultsFile=liquibase.properties update
MongoDB Pro driver
You can install the Liquibase MongoDB Pro JDBC driver in your container image using the Liquibase Package Manager (LPM). In your command line, enter the following command:
lpm add liquibase-commercial-mongodb@1.5.0
MySQL driver
The JDBC driver for MySQL has licensing restrictions that prevent it from being preinstalled into the container image. You must load the driver in one of the following ways:
Dockerfile:
FROM liquibase
RUN lpm add mysql --global
Then enter this command in the CLI:
docker build . -t liquibase-mysql
For more information, see docker build.
Set environment variable at runtime
Alternatively, enter this command in the CLI:
docker run -e INSTALL_MYSQL=true liquibase update
For more information, see Docker run reference § ENV (environment variables).
Complete examples
Command line
Specifying everything using arguments:
docker run --rm -v <PATH TO CHANGELOG DIR>:/liquibase/changelog liquibase
--license-key="<PASTE LB PRO LICENSE KEY HERE>"
update
--url=jdbc:postgresql://<IP OR HOSTNAME>:5432/<DATABASE>?currentSchema=<SCHEMA NAME>
--changelog-file=com/example/changelog.xml --username=<USERNAME>
--password=<PASSWORD>
Using with Liquibase environment variables example:
docker run --env LIQUIBASE_COMMAND_USERNAME --env LIQUIBASE_COMMAND_PASSWORD --env LIQUIBASE_COMMAND_URL --env LIQUIBASE_PRO_LICENSE_KEY --env LIQUIBASE_COMMAND_CHANGELOG_FILE --rm -v <PATH TO CHANGELOG DIR>/changelogs:/liquibase/changelog liquibase --log-level=info update
Properties file
Use the following example for configuring the liquibase.docker.properties
file
classpath: /liquibase/changelog
url: jdbc:postgresql://<IP OR HOSTNAME>:5432/<DATABASE>?currentSchema=<SCHEMA NAME>
changelog-file: changelog.xml
username: <USERNAME>
password: <PASSWORD>
licenseKey=<PASTE LB PRO LICENSE KEY HERE>
Use the --defaults-file
parameter to invoke the liquibase.docker.properties
file when running commands in the CLI:
docker run --rm -v <PATH TO CHANGELOG DIR>:/liquibase/changelog liquibase/--defaults-file=/liquibase/changelog/liquibase.docker.properties update
Troubleshooting issues with Liquibase and Docker
If you use the Liquibase Docker image 4.3.5 with Aurora MySQL RDS Cluster and have issues with the connection link, add ?autoReconnect=true"&"useSSL=false
to the end of the database name in your URL:
--url=jdbc:mysql://devops-test.us-east-2.rds.amazonaws.com:3306/auditsource?autoReconnect=true"&"useSSL=false