As a developer tool, spotify/dockerfile-maven has picked up 2.7k stars on GitHub (Java). MATURE: A set of Maven tools for dealing with Dockerfiles
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
At this point, we're not developing or accepting new features or even fixing non-critical bugs.
This Maven plugin integrates Maven with Docker.
The design goals are:
Don't do anything fancy. Dockerfiles are how you build
Docker projects; that's what this plugin uses. They are
mandatory.
Make the Docker build process integrate with the Maven build
process. If you bind the default phases, when you type mvn package, you get a Docker image. When you type mvn deploy,
your image gets pushed.
Make the goals remember what you are doing. You can type mvn dockerfile:build and later mvn dockerfile:tag and later mvn dockerfile:push without problems. This also eliminates the need
for something like mvn dockerfile:build -DalsoPush; instead you
can just say mvn dockerfile:build dockerfile:push.
Integrate with the Maven build reactor. You can depend on the
Docker image of one project in another project, and Maven will
build the projects in the correct order. This is useful when you
want to run integration tests involving multiple services.
This project adheres to the Open Code of Conduct.
By participating, you are expected to honor this code.
See the changelog for a list of releases
Set-up
This plugin requires Java 7 or later and Apache Maven 3 or later (dockerfile-maven-plugin <=1.4.6 needs
Maven >= 3, and for other cases, Maven >= 3.5.2). To run the integration tests or to use the plugin in practice, a working
Docker set-up is needed.
Example
For more examples, see the integration test directory.
In particular, the advanced test showcases a
full service consisting of two micro-services that are integration
tested using helios-testing.
This configures the actual plugin to build your image with mvn package and push it with mvn deploy. Of course you can also say
mvn dockerfile:build explicitly.
FROM openjdk:8-jre
MAINTAINER David Flemström <[email protected]>
ENTRYPOINT ["/usr/bin/java", "-jar", "/usr/share/myservice/myservice.jar"]
# Add Maven dependencies (not shaded into the artifact; Docker-cached)
ADD target/lib /usr/share/myservice/lib
# Add the service itself
ARG JAR_FILE
ADD target/${JAR_FILE} /usr/share/myservice/myservice.jar
Important note
The most Maven-ish way to reference the build artifact would probably
be to use the project.build.directory variable for referencing the
'target'-directory. However, this results in an absolute path, which
is not supported by the ADD command in the Dockerfile. Any such source
must be inside the context of the Docker build and therefor must be
referenced by a relative path. See https://github.com/spotify/dockerfile-maven/issues/101
Do not use ${project.build.directory} as a way to reference your
build directory.
What does it give me?
There are many advantages to using this plugin for your builds.
Faster build times
This plugin lets you leverage Docker cache more consistently, vastly
speeding up your builds by letting you cache Maven dependencies in
your image. It also encourages avoiding the maven-shade-plugin,
which also greatly speeds up builds.
With the basic configuration, this will make sure that the image is
built and pushed at the correct times.
Depend on Docker images of other services
You can depend on the Docker information of another project, because
this plugin attaches project metadata when it builds Docker images.
Simply add this information to any project:
You can now use these projects with Fig or docker-compose or some
other system that works with Dockerfiles. For example, a
docker-compose.yml might look like:
How active is development on spotify/dockerfile-maven?
The most recent commit recorded on spotify/dockerfile-maven was 4.8 years ago, based on the GitHub push timestamp. The repository has 476 forks — one of the better signals of community interest.
How many stars does spotify/dockerfile-maven have?
spotify/dockerfile-maven has 2.7k GitHub stars — refresh the page for the live number, or check github.com/spotify/dockerfile-maven. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is spotify/dockerfile-maven open source?
Yes — spotify/dockerfile-maven ships under the Apache-2.0 license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/spotify/dockerfile-maven.
What else is in the Developer Tools space?
spotify/dockerfile-maven is tracked by TopGit under the Developer Tools category, alongside 3 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What is spotify/dockerfile-maven?
spotify/dockerfile-maven (spotify/dockerfile-maven) is a Java project on GitHub. From the project's own README: MATURE: A set of Maven tools for dealing with Dockerfiles
What language is spotify/dockerfile-maven written in?
spotify/dockerfile-maven is written primarily in Java. GitHub's language field is based on the largest share of bytes in the default branch.
What license does spotify/dockerfile-maven use?
spotify/dockerfile-maven is released under the Apache-2.0 license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where do I read more about spotify/dockerfile-maven?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/spotify/dockerfile-maven is the definitive source.
Read full README in the tab above.
Want a second opinion on dockerfile-maven?
Ask an AI that can read this page — one click and you get its take on dockerfile-maven.