https://github.com/liquibase/docker
https://github.com/liquibase/docker
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/liquibase/docker
- Owner: liquibase
- License: apache-2.0
- Created: 2019-09-24T16:05:06.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2025-02-06T18:57:26.000Z (8 months ago)
- Last Synced: 2025-02-06T19:44:32.514Z (8 months ago)
- Language: Dockerfile
- Homepage:
- Size: 2.74 MB
- Stars: 65
- Watchers: 10
- Forks: 76
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Official Liquibase Docker Images
## 🚨 Notice: New Official Liquibase Docker Image 🚨
We are excited to announce that a new official Liquibase Docker image is now available at [https://hub.docker.com/_/liquibase](https://hub.docker.com/_/liquibase) starting with liquibase 4.27.0 and newer. We recommend all users to start using this image for the latest updates and support. Any versions prior to 4.27.0 will only be available on the existing `liquibase/liquibase` community image.
### 🔧 Action Required
Please update your Dockerfiles and scripts to pull from the new official image:
## Dockerfile
```dockerfile
FROM liquibase:latest
```## Scripts
```bash
docker pull liquibase
```In the future, we will stop updating the community `liquibase/liquibase` Docker image. Transition to the new official image to ensure you continue receiving updates and support.
For any questions or support, please visit our [Liquibase Community Forum](https://forum.liquibase.org/).
---
This is the community repository for [Liquibase](https://download.liquibase.org/) images.
## 🚨 BREAKING CHANGE
Support for Snowflake database has been moved from the external extension liquibase-snowflake into the main Liquibase artifact. This means that Snowflake is now included in the main docker image. If you are using the snowflake extension, remove it from your lib directory or however you are including it in your project. If you are using the Docker image, use the main v4.12+ as there will no longer be a snowflake separate docker image produced. The latest separate Snowflake image will be v4.11. You need to update your reference to either latest to use the main one that includes Snowflake or the version tag you prefer.
## 🏷️ Supported Tags
The following tags are officially supported and can be found on [Docker Hub](https://hub.docker.com/r/liquibase/liquibase/tags):
- `liquibase/liquibase:`
- `liquibase/liquibase:-alpine`## 📦 Using the Docker Image
### 🏷️ Standard Image
The `liquibase/liquibase:` image is the standard choice. Use it as a disposable container or a foundational building block for other images.
For examples of extending the standard image, see the [standard image examples](https://github.com/liquibase/docker/tree/main/examples).
### 🏷️ Alpine Image
The `liquibase/liquibase:-alpine` image is a lightweight version designed for environments with limited resources. It is built on Alpine Linux and has a smaller footprint.
For examples of extending the alpine image, see the [alpine image examples](https://github.com/liquibase/docker/tree/main/examples).
### 📄 Using the Changelog File
Mount your changelog directory to the `/liquibase/changelog` volume and use relative paths for the `--changeLogFile` argument.
#### Example
```shell
docker run --rm -v /path/to/changelog:/liquibase/changelog liquibase/liquibase --changeLogFile=changelog.xml update
```### ⚙️ Using a Configuration File
To use a default configuration file, mount it in your changelog volume and reference it with the `--defaultsFile` argument.
#### Example
```shell
docker run --rm -v /path/to/changelog:/liquibase/changelog liquibase/liquibase --defaultsFile=liquibase.properties update
```### 📚 Including Drivers and Extensions
Mount a local directory containing additional jars to `/liquibase/lib`.
#### Example
```shell
docker run --rm -v /path/to/changelog:/liquibase/changelog -v /path/to/lib:/liquibase/lib liquibase/liquibase update
```### 🔍 MySQL Users
Due to licensing restrictions, the MySQL driver is not included. Add it either by extending the image or during runtime via an environment variable.
#### Extending the Image
Dockerfile:
```dockerfile
FROM liquibase:latestRUN lpm add mysql --global
```Build:
```shell
docker build . -t liquibase-mysql
```#### Runtime
```shell
docker run -e INSTALL_MYSQL=true liquibase/liquibase update
```## 🛠️ Complete Example
Here is a complete example using environment variables and a properties file:
### Environment Variables Example
```shell
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:/liquibase/changelog liquibase/liquibase --log-level=info update
```### Properties File Example
`liquibase.docker.properties` file:
```properties
searchPath: /liquibase/changelog
url: jdbc:postgresql://:5432/?currentSchema=
changeLogFile: changelog.xml
username:
password:
liquibaseProLicenseKey=
```CLI:
```shell
docker run --rm -v /path/to/changelog:/liquibase/changelog liquibase/liquibase --defaultsFile=liquibase.docker.properties update
```## 🔗 Example JDBC URLs
- MS SQL Server: `jdbc:sqlserver://:1433;database=`
- PostgreSQL: `jdbc:postgresql://:5432/?currentSchema=`
- MySQL: `jdbc:mysql://:3306/`
- MariaDB: `jdbc:mariadb://:3306/`
- DB2: `jdbc:db2://:50000/`
- Snowflake: `jdbc:snowflake:///?db=&schema=`
- Sybase: `jdbc:jtds:sybase://:/`
- SQLite: `jdbc:sqlite:/tmp/.db`For more details, visit our [Liquibase Documentation](https://docs.liquibase.com/).
![]()