Applies to:
- Liquibase Pro
- Liquibase Open Source (Community)
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:
changeLogFile: changelog.xml
username:
password:
liquibaseProLicenseKey=
-
- Set up your changesets in changelog.xml
- Copy and paste the following docker run command into your CLI and update the placeholders:
-
docker run --rm -v
- is the path to where your changelog/files are located. This directory is mapped as a volume to /liquibase/changelog inside the docker image.
- is the tag representing the version of Liquibase to use. All available versions can be found on the Official Liquibase Docker images page.
-
Using runtime arguments
- Set up your changes in your changelog.xml
- Copy and paste the following docker run command into your CLI and update the placeholders:
-
docker run --rm -v <PATH TO MY_APP>:/liquibase/changelog liquibase/liquibase:<VERSION> --url=<CONNECTION_URL> --changeLogFile=com/example/changelog.xml --username=<USERNAME> --password=<PASSWORD> --liquibaseProLicenseKey="<PASTE LB PRO LICENSE KEY HERE>" <COMMAND>
-
<PATH TO MY_APP>
is the path to where your changelog/files are located. This directory is mapped as a volume to /liquibase/changelog inside the docker image. -
<VERSION>
is the tag representing the version of Liquibase to use. All available versions can be found on the Official Liquibase Docker images page. -
<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. -
<PASTE LB PRO LICENSE KEY HERE>
is optional. This is the pro license key to access pro features. -
<COMMAND>
is the liquibase command that will be run.
-
Comments
0 comments
Article is closed for comments.