Naturally, we could build our Docker image using Docker itself. But this is not a typical use case for Spring developers. A typical use case for us would be to use Maven. This can be especially useful, if you have continuous integration flow set up, using Jenkins for example. Delegating the image build process to Maven gives you a lot of flexibility and also saves a lot of time. There is at least a couple of Docker Maven plugins available for free on GitHub, such as:
- https://github.com/spotify/docker-maven-plugin: A Maven plugin for building and pushing Docker images by Spotify.
- https://github.com/alexec/docker-maven-plugin.
- https://github.com/fabric8io/docker-maven-plugin: This is the one I find to be most ...