Skip to content

Commit 75c7639

Browse files
authored
Upgrade Flyway and fix Dockerfile. (#1110)
1 parent 027d853 commit 75c7639

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

sandbox/flyway.Dockerfile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
FROM centos
22

3+
ARG FLYWAY_VERSION=8.5.4
4+
35
# Get flyway
4-
RUN ["curl", "-O", "https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/6.0.0/flyway-commandline-6.0.0-linux-x64.tar.gz"]
5-
RUN ["yum", "install", "-y", "tar", "java-1.8.0-openjdk", "postgresql-jdbc", "nc", "postgresql"]
6-
RUN ["tar", "-xzf", "flyway-commandline-6.0.0-linux-x64.tar.gz"]
6+
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
7+
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
8+
RUN yum install -y tar java-1.8.0-openjdk postgresql-jdbc nc postgresql
9+
RUN curl -O https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/${FLYWAY_VERSION}/flyway-commandline-${FLYWAY_VERSION}-linux-x64.tar.gz
10+
RUN tar -xzf flyway-commandline-${FLYWAY_VERSION}-linux-x64.tar.gz
711

8-
WORKDIR flyway-6.0.0
12+
WORKDIR flyway-${FLYWAY_VERSION}
913

1014
# Copy the postgres driver to its required location
11-
RUN ["cp", "/usr/share/java/postgresql-jdbc.jar", "jars/"]
12-
RUN ["mkdir", "/opt/migrations"]
13-
RUN ["mkdir", "/opt/scripts"]
15+
RUN cp /usr/share/java/postgresql-jdbc.jar jars/
16+
RUN mkdir /opt/migrations
17+
RUN mkdir /opt/scripts
1418
COPY ./cuebot/src/main/resources/conf/ddl/postgres/migrations /opt/migrations
1519
COPY ./cuebot/src/main/resources/conf/ddl/postgres/seed_data.sql /opt/scripts
1620
COPY ./sandbox/migrate.sh /opt/scripts/

0 commit comments

Comments
 (0)