Official Flyway Dockerfile #797
Would you consider establishing and supporting a Dockerfile for running flyway?
Here is a complete example that I am using in my own projects:
FROM centos:centos7 MAINTAINER ToBeReplaced # Get flyway RUN ["curl", "-O", "http://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/3.0/flyway-commandline-3.0.tar.gz"] RUN ["yum", "install", "-y", "tar"] RUN ["tar", "-xzf", "flyway-commandline-3.0.tar.gz"] # Install java and the jdbc postgres driver RUN ["yum", "install", "-y", "java-1.7.0-openjdk-headless"] RUN ["yum", "install", "-y", "postgresql-jdbc"] WORKDIR flyway-3.0 # Copy the postgres driver to its required location RUN ["cp", "/usr/share/java/postgresql-jdbc.jar", "jars/"] ENTRYPOINT ["./flyway"]
This allows you to run flyway inside of its own container. Example:
The text was updated successfully, but these errors were encountered:
@axelfontaine Thanks for the official release!
I do have to ask about why volumes were added. It prevents extending the image cleanly e.g.,
Unless there is a trick I don't know about, having volumes defined requires the use of multistage-build pattern, or repeating the entire contents of the dockerfile.
Can volumes be removed from the dockerfile? They are easy to add and usage can be documented in readme. But once they are there, base images are hard to extend.