Applies to:
- Liquibase Pro
- Liquibase Open Source (Community)
Question:
Can the Liquibase Docker image have more files? For example, can it have extension jars to connect to Redshift, Cassandra, etc.?
Answer:
The Liquibase Docker image only contains the base files that come with the installation of Liquibase, but you can build off the Liquibase image using a Dockerfile to add additional files to the image.
This same approach can be applied to any type of file that needs to be added to the Docker image.
In the Dockerfile example below (this example is adding the Redshift driver and Liquibase extensions), the base image is Liquibase. Then the Dockerfile will download the required files and place them in the /lib
folder.
Example Dockerfile:
FROM liquibase/liquibase:latest
# Set the Redshift JDBC driver version and the Liquibase Redshift Extension version.
ENV REDSHIFT_JDBC_DRIVER_VERSION 2.1.0.12
ENV LIQUIBASE_REDSHIFT_EXTENSION_VERSION 4.28.0
# Download the Redshift JDBC driver and the Liquibase Redshift Extension jar and place them into the /liquibase/lib directory
RUN curl -L -o /liquibase/lib/RedshiftJDBC42-no-awssdk-${REDSHIFT_JDBC_DRIVER_VERSION}.jar \
https://s3.amazonaws.com/redshift-downloads/drivers/jdbc/2.1.0.12/RedshiftJDBC42-no-awssdk-2.1.0.12.jar
RUN curl-L-o/liquibase/lib/liquibase-redshift-${LIQUIBASE_REDSHIFT_EXTENSION_VERSION}.jar\
https://github.com/liquibase/liquibase-redshift/releases/download/untagged-2153c6584dfd027bce28/liquibase-redshift-4.28.0.jar
Once you have the Dockerfile configured to include any additional files, you will then build a new image, which will have the base files from Liquibase and the additional files.
For reference, an image can be built from a Dockerfile using the following command docker build -t
If you are using the above example, you can navigate to where that Dockerfile exists and run docker build -t liquibase-redshift .
which creates an image called "liquibase-redshift."
Related Article(s):
N/A
Comments
0 comments
Article is closed for comments.