Skip to content

Latest commit

 

History

History

docker

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Liquibase Percona Docker images

This combines the Official Liquibase Docker images with Liquibase Percona Extension and Percona Toolkit.

Supported tags

Usage

Execute a database update by simply running liquibase. The liquibase-percona extension and pt-online-schema-change will automatically be picked up:

docker run --rm -v <PATH TO CHANGELOG DIR>:/liquibase/changelog \
    andreasdangel/liquibase-percona \
    --url="jdbc:mysql://<IP OR HOSTNAME>:3306/<DATABASE>" \
    --changeLogFile=com/example/changelog.xml \
    --username=<USERNAME> --password=<PASSWORD> \
    --logLevel=info \
    update

If you want to set a system property, e.g. liquibase.percona.defaultOn=false, you need to use "-e JAVA_OPTS".

docker run --rm -v <PATH TO CHANGELOG DIR>:/liquibase/changelog \
    -e JAVA_OPTS=-Dliquibase.percona.defaultOn=false \
    andreasdangel/liquibase-percona \
    --url="jdbc:mysql://<IP OR HOSTNAME>:3306/<DATABASE>" \
    --changeLogFile=com/example/changelog.xml \
    --username=<USERNAME> --password=<PASSWORD> \
    --logLevel=info \
    update

You can also run pt-online-schema-change directly, e.g.:

docker run --rm andreasdangel/liquibase-percona /usr/local/bin/pt-online-schema-change \
    --alter-foreign-keys-method=auto --nocheck-unique-key-change \
    --alter="ADD COLUMN name VARCHAR(50) NOT NULL" \
    --password=<PASSWORD> \
    --dry-run --print \
    h=<IP OR HOSTNAME>,P=3306,u=<USERNAME>,D=<DATABASE>,t=<TABLE NAME>

Source