Skip to content

Commit

Permalink
Merge pull request #174 from liquibase/DAT-10956
Browse files Browse the repository at this point in the history
DAT-10956 Docker Native Executors Examples
  • Loading branch information
jnewton03 authored Sep 26, 2022
2 parents 0725716 + 2ec7d62 commit 04ba9ac
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,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/binaries such as Oracle SQL*Plus, Microsoft SQLCMD, Postgres PSQL, or the AWS CLI is to extend the liquibase/liquibase Dockerfile. Examples are provided in the [Examples](/examples) Directory.
6 changes: 6 additions & 0 deletions examples/aws/Dockerfile.awscli
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM liquibase/liquibase:latest
USER root
RUN wget "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -O "awscliv2.zip" && \
unzip awscliv2.zip && rm -rf awscliv2.zip && \
./aws/install
USER liquibase
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
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
3 changes: 0 additions & 3 deletions mysql/Dockerfile

This file was deleted.

0 comments on commit 04ba9ac

Please sign in to comment.