-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
31 lines (21 loc) · 1004 Bytes
/
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
FROM alpine
MAINTAINER "Nono Elvadas"
ENV FLYWAY_VERSION=4.2.0
ENV FLYWAY_HOME=/opt/flyway/$FLYWAY_VERSION \
FLYWAY_PKGS="https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/${FLYWAY_VERSION}/flyway-commandline-${FLYWAY_VERSION}.tar.gz"
LABEL com.redhat.component="flyway" \
io.k8s.description="Platform for upgrading database using flyway" \
io.k8s.display-name="DB Migration with flyway " \
io.openshift.tags="builder,sql-upgrades,flyway,db,migration"
RUN apk add --update \
openjdk8-jre \
wget \
bash
#Download and flyway
RUN wget --no-check-certificate $FLYWAY_PKGS &&\
mkdir -p $FLYWAY_HOME && \
mkdir -p /var/flyway/data && \
tar -xzf flyway-commandline-$FLYWAY_VERSION.tar.gz -C $FLYWAY_HOME --strip-components=1
VOLUME /var/flyway/data
ENTRYPOINT cp -f /var/flyway/data/*.sql $FLYWAY_HOME/sql/ && \
$FLYWAY_HOME/flyway baseline migrate info -user=${DB_USER} -password=${DB_PASSWORD} -url=${DB_URL}