Applies to:
- Liquibase Secure (Pro)
- Liquibase Community (Open Source)
Summary:
Liquibase publishes an official Docker image for many versions of Liquibase. There are two common configuration methods when using the official Liquibase Docker image.
Environment Conditions:
- Docker installed
Setup:
All examples below are based on the following folder structure
- my_app
- changelog.xml
- liquibase.docker.properties
How to use the official Liquibase Docker image:
Using a properties file
- Inside the liquibase.docker.properties file, set the following:
classpath: /liquibase/changelog url: <DATABASE CONNECTION URL> changeLogFile: changelog.xml username: <USERNAME> password: <PASSWORD> liquibase.licenseKey: <LIQUIBASE SECURE LICENSE KEY>
- Set up your changesets in changelog.xml
- Copy and paste the following Docker run command into your CLI and replace the placeholders:
docker run --rm -v <PATH TO my_app>:/liquibase/changelog liquibase/liquibase-secure:<VERSION> --defaults-file=/liquibase/changelog/liquibase.docker.properties <COMMAND>-
<PATH TO my_app>is the path to where your changelog files are located. This directory is mapped as a volume to/liquibase/changeloginside the Docker image. -
<VERSION>is the tag representing the version of Liquibase Secure to use. All available versions can be found on the Official Liquibase Secure Docker images page. Using latest will use the latest version each time it is invoked. -
<COMMAND>is the Liquibase command that will be run.
Using runtime arguments
- Set up your changes in your changelog.xml
- Copy and paste the following docker run command into your CLI and replace the placeholders:
docker run --rm -v <PATH TO my_app>:/liquibase/changelog liquibase/liquibase-secure:<VERSION> --url=<CONNECTION URL> --changeLogFile=com/example/changelog.xml --username=<USERNAME> --password=<PASSWORD> --license-key="<LIQUIBASE SECURE LICENSE KEY>" <COMMAND>-
<PATH TO my_app>is the path to where your changelog files are located. This directory is mapped as a volume to/liquibase/changeloginside the Docker image. -
<VERSION>is the tag representing the version of Liquibase Secure to use. All available versions can be found on the Official Liquibase Secure Docker images page. Using latest will use the latest version each time it is invoked. -
<CONNECTION URL>is the JDBC connection string for the database Liquibase will connect to. -
<USERNAME>is the username Liquibase will use to connect to the database. -
<PASSWORD>is the password Liquibase will use to connect to the database. -
<LIQUIBASE SECURE LICENSE KEY>is the Liquibase Secure license key. -
<COMMAND>is the Liquibase command that will be run.
Comments
0 comments
Article is closed for comments.