Skip to content

Commit

Permalink
DAT-10956 Docker Native Executors Examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jnewton03 committed Aug 31, 2022
1 parent 54f122b commit a9d34d4
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,7 @@ or `docker run --rm -v <PATH TO CHANGELOG DIR>:/liquibase/changelog liquibase/li
- SQLite: `jdbc:sqlite:/tmp/<DB FILE NAME>.db`

Note: If the database IP refers to a locally running docker container then one needs to specify host networking like `docker run --network=host -rm -v ...`

#### Adding Native Executors

The recommended path for adding native executors such as Oracle SQL*Plus, Microsoft SQLCMD, or Postgres PSQL is to extend the liquibase/liquibase Dockerfile. Examples are provided in the [Examples](/examples) Directory.
15 changes: 15 additions & 0 deletions examples/mssql/Dockerfile.sqlcmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM liquibase/liquibase:latest

# Install SQLCMD
USER root
RUN wget -qO - https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
wget -qO - https://packages.microsoft.com/config/ubuntu/20.04/prod.list | tee /etc/apt/sources.list.d/msprod.list && \
apt-get update -y && \
ACCEPT_EULA=Y apt-get install --no-install-recommends -y mssql-tools unixodbc-dev && \
rm -rf /var/lib/apt/lists/*

# Set SQLCMD Env Vars
ENV PATH="$PATH:/opt/mssql-tools/bin"

# Return to liquibase user space
USER liquibase
File renamed without changes.
17 changes: 17 additions & 0 deletions examples/oracle/Dockerfile.sqlplus
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM liquibase/liquibase:latest

# Install SQLPlus
USER root
RUN apt-get update && apt-get -y install libaio1 libaio-dev && rm -rf /var/lib/apt/lists/*
RUN mkdir /opt/oracle
# You must already have the sqlplus archives downloaded from Oracle
COPY instantclient-sqlplus-linux.x64-19.12.0.0.0dbru.zip instantclient-basic-linux.x64-19.12.0.0.0dbru.zip .
RUN sh -c 'unzip -q "*.zip" -d /opt/oracle/'
RUN rm *.zip

# Set SQLPlus Env Vars
ENV PATH="$PATH:/opt/oracle/instantclient_19_12"
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/oracle/instantclient_19_12"

# Return to liquibase user space
USER liquibase
10 changes: 10 additions & 0 deletions examples/postgres/Dockerfile.psql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM liquibase/liquibase:latest

# Install PSQL
USER root
RUN apt-get update -y && \
apt-get install --no-install-recommends -y postgresql-client && \
rm -rf /var/lib/apt/lists/*

# Return to liquibase user space
USER liquibase

0 comments on commit a9d34d4

Please sign in to comment.