forked from liquibase/docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
58 lines (46 loc) · 2.08 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM openjdk:11-jre-slim-buster
# Install GNUPG for package vefification and WGET for file download
RUN apt-get update \
&& apt-get upgrade \
&& apt-get -yqq install krb5-user libpam-krb5 \
&& apt-get -y install gnupg wget unzip \
&& rm -rf /var/lib/apt/lists/*
# Add the liquibase user and step in the directory
RUN addgroup --gid 1001 liquibase
RUN adduser --disabled-password --uid 1001 --ingroup liquibase liquibase
# Make /liquibase directory and change owner to liquibase
RUN mkdir /liquibase && chown liquibase /liquibase
WORKDIR /liquibase
#Symbolic link will be broken until later
RUN ln -s /liquibase/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh \
&& ln -s /liquibase/docker-entrypoint.sh /docker-entrypoint.sh \
&& ln -s /liquibase/liquibase /usr/local/bin/liquibase \
&& ln -s /liquibase/bin/lpm /usr/local/bin/lpm
# Change to the liquibase user
USER liquibase
# Latest Liquibase Release Version
ARG LIQUIBASE_VERSION=4.11.0
ARG LPM_VERSION=0.1.3
# Download, verify, extract
ARG LB_SHA256=5ba5d7c155e9d6b3dace1a5290abc3adba26ea2199f54aae82f98507845b1b1b
RUN set -x \
&& wget -O liquibase-${LIQUIBASE_VERSION}.tar.gz "https://github.com/liquibase/liquibase/releases/download/v${LIQUIBASE_VERSION}/liquibase-${LIQUIBASE_VERSION}.tar.gz" \
&& echo "$LB_SHA256 liquibase-${LIQUIBASE_VERSION}.tar.gz" | sha256sum -c - \
&& tar -xzf liquibase-${LIQUIBASE_VERSION}.tar.gz \
&& rm liquibase-${LIQUIBASE_VERSION}.tar.gz
# Download and Install lpm \
RUN mkdir /liquibase/bin
RUN wget -q -O lpm.zip "https://github.com/liquibase/liquibase-package-manager/releases/download/v${LPM_VERSION}/lpm-${LPM_VERSION}-linux.zip"
RUN unzip lpm.zip -d bin/
RUN rm lpm.zip
RUN export LIQUIBASE_HOME=/liquibase
# Install Drivers
RUN lpm update
RUN lpm add snowflake liquibase-snowflake --global
RUN /liquibase/liquibase --version
COPY --chown=liquibase:liquibase docker-entrypoint.sh /liquibase/
COPY --chown=liquibase:liquibase liquibase.docker.properties /liquibase/
VOLUME /liquibase/classpath
VOLUME /liquibase/changelog
ENTRYPOINT ["/liquibase/docker-entrypoint.sh"]
CMD ["--help"]