There are various Docker Maven plugins that can be used:
You can use any of these. I found the Docker Maven plugin by @rhuss to be best suited for us. It has not been updated for a while, but it works perfectly.
We need to introduce the Docker Spring profile in application.yml before we start discussing the configuration of docker-maven-plugin. It will make our job easier when building services for various platforms.
Configuring the Spring profile for Docker:
- We'll use the Spring profile identified as Docker.
- There won't be any conflict of ports among embedded Tomcat, ...