{"id":16367932,"url":"https://github.com/kilna/liquibase-docker","last_synced_at":"2025-03-23T02:33:08.121Z","repository":{"id":54184267,"uuid":"102283711","full_name":"kilna/liquibase-docker","owner":"kilna","description":"A lightweight docker for running liquibase with support for various databases","archived":false,"fork":false,"pushed_at":"2021-03-04T16:29:52.000Z","size":29,"stargazers_count":18,"open_issues_count":9,"forks_count":18,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-12T02:51:18.496Z","etag":null,"topics":["database","docker-image","dockerfile","liquibase","liquibase-docker"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kilna.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-03T18:00:09.000Z","updated_at":"2024-02-19T14:17:36.000Z","dependencies_parsed_at":"2022-08-13T08:40:24.245Z","dependency_job_id":null,"html_url":"https://github.com/kilna/liquibase-docker","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kilna%2Fliquibase-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kilna%2Fliquibase-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kilna%2Fliquibase-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kilna%2Fliquibase-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kilna","download_url":"https://codeload.github.com/kilna/liquibase-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221842778,"owners_count":16890202,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","docker-image","dockerfile","liquibase","liquibase-docker"],"created_at":"2024-10-11T02:51:14.096Z","updated_at":"2024-10-28T14:46:26.473Z","avatar_url":"https://github.com/kilna.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# liquibase-docker\n\n[![](https://images.microbadger.com/badges/image/kilna/liquibase.svg)](https://microbadger.com/images/kilna/liquibase)\n[![](https://img.shields.io/docker/pulls/kilna/liquibase.svg?style=plastic)](https://hub.docker.com/r/kilna/liquibase/)\n[![](https://img.shields.io/docker/stars/kilna/liquibase.svg?style=plastic)](https://hub.docker.com/r/kilna/liquibase/)\n[![](https://img.shields.io/badge/docker_build-automated-blue.svg?style=plastic)](https://cloud.docker.com/swarm/kilna/repository/docker/kilna/liquibase/builds)\n\n**A lightweight Docker for running [Liquibase](https://www.liquibase.org)**\n\nDockerHub: [liquibase](https://hub.docker.com/r/kilna/liquibase/) - GitHub: [liquibase-docker](https://github.com/kilna/liquibase-docker)\n\n# Liquibase Docker images with drivers\n\n**Liquibase by itself cannot connect to a database.** To do actual database work, you will need a [JDBC driver](https://en.wikipedia.org/wiki/JDBC_driver).\n\n**⚠ You probably want one of these other Docker images where I've bundled a database driver alongside Liquibase ⚠**\n\n| DockerHub Image | GitHub Source |\n|---|---|\n| [**liquibase-postgres**](https://hub.docker.com/r/kilna/liquibase-postgres/) | [liquibase-postgres-docker](https://github.com/kilna/liquibase-postgres-docker) |\n| [**liquibase-mysql**](https://hub.docker.com/r/kilna/liquibase-mysql/) | [liquibase-mysql-docker](https://github.com/kilna/liquibase-mysql-docker) |\n| [**liquibase-mariadb**](https://hub.docker.com/r/kilna/liquibase-mariadb/) | [liquibase-mariadb-docker](https://github.com/kilna/liquibase-mariadb-docker) |\n| [**liquibase-sqlite**](https://hub.docker.com/r/kilna/liquibase-sqlite/) | [liquibase-sqlite-docker](https://github.com/kilna/liquibase-sqlite-docker) |\n\n# Usage\n\n## Using your own derived Dockerfile\n\nYou can use this image by creating your own `Dockerfile` which inherits using a FROM line:\n\n```\nFROM kilna/liquibase-mysql-docker\nENV LIQUIBASE_HOST=database.server\nENV LIQUIBASE_DATABASE=dbname\nENV LIQUIBASE_USERNAME=user\nENV LIQUIBASE_PASSWORD=pass\nCOPY changelog.xml /workspace\n```\n\nMake sure to create an appropriate [changelog.xml](http://www.liquibase.org/documentation/xml_format.html) in the same directory as your Dockerfile.\n\nThen you can build your derived Dockerfile to an image tagged 'changelog-image':\n\n```\n$ docker build --tag changelog-image .\n```\n\nAny time you make changes to the example project, you'll need to re-run the `docker build` command above, or you can using docker volumes as described below to sync local filesystem changes into the container. To run liquibase using the new image you can:\n\n```\n$ docker run changelog-image liquibase updateTestingRollback\n```\n\nSince the working directory within the container is /workspace, and since the entrypoint generates a a liquibase.properties file using the provided environment variables, it will know to look for _changelog.xml_ by default and apply the change.  See the environment variables below to change this behavior.\n\n## Using the image directly with a mounted docker volume\n\nIf you'd like to apply a changelog to a MySQL database without deriving your own container, run the contiainer\nappropriate to your database like so... where _/local/path/to/changelog/_ is the directory where a valid [changelog.xml](http://www.liquibase.org/documentation/xml_format.html) exists:\n\n```\n$ docker run -e LIQUIBASE_HOST=database.server -e LIQUIBASE_USERNAME=user -e LIQUIBASE_PASSWORD=pass \\\n    -e LIQUIBASE_DATABASE=dbname -v /local/path/to/changelog/:/workspace/ kilna/liquibase-mysql \\\n    liquibase updateTestingRollback\n```\n\n# Environment Variables and liquibase.properties\n\nThis docker image has a working Liquibase executable in the path, and an entrypoint which auto-generates a [liquibase.properties](http://www.liquibase.org/documentation/liquibase.properties.html) file.\n\nIn order to create the liquibase.properties file, it uses the follow environment variables when the image is started with 'docker run':\n\n| Environment Variable | Purpose | Default |\n|----------------------|---------|---------|\n| LIQUIBASE_HOST       | Database host to connect to* | db |\n| LIQUIBASE_PORT       | Database port to connect to* | _driver-specific integer \u003cbr\u003e example: 3306 for MySQL/MariaDB_ |\n| LIQUIBASE_DATABASE   | Database name to connect to† | liquibase |\n| LIQUIBASE_USERNAME   | Username to connect to database as* | liquibase |\n| LIQUIBASE_PASSWORD   | Password for username* | liquibase |\n| LIQUIBASE_CHANGELOG  | Default changelog filename to use | changelog.xml |\n| LIQUIBASE_LOGLEVEL   | Log level as defined by Liquibase \u003cbr\u003e _Valid values: debug, info, warning, severe, off_ | info |\n| LIQUIBASE_CLASSPATH  | JDBC driver filename | _driver-specific \u003cbr\u003e example: /opt/jdbc/mysql-jdbc.jar_ |\n| LIQUIBASE_DRIVER     | JDBC object path | _driver-specific \u003cbr\u003e example: org.mariadb.jdbc.Driver_ |\n| LIQUIBASE_URL        | JDBC URL for connection | _driver-specific \u003cbr\u003e example: jdbc:mariadb://${HOST}:${PORT}/${DATABASE}_ |\n| LIQUIBASE_DEBUG      | If set to 'yes', when _docker run_ is executed, will show the values of all LIQUIBASE_* environment variables and describes any substitutions performed on _liquibase.properties_ | _unset_ |\n\n_* Not applicable to file-based databases (SQLite) - † Used as the filename for file-based databases (SQLite)_\n\nThe generated _liquibase.properties_ file is loaded into the default working dir _/workspace_ (which is also shared as a docker volume). The _/workspace/liquibase.properties_ file will have any variables substituted each time a 'docker run' command is performed...  so you can load your own _/workspace/liquibase.properties_ file and put `${HOST}` in it, and it will be replaced with the LIQUIBASE_HOST environment variable.\n\nIf you want to see what the contents of the generated _liquibase.properties_ file are, you can:\n\n```\n$ docker run image-name cat liquibase.properties\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkilna%2Fliquibase-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkilna%2Fliquibase-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkilna%2Fliquibase-docker/lists"}