Question using maven template and docker template

  docker, java, maven

I have just arrived on a project which is in the transformation phase and I would like to set up two templates that you propose. Maven and docker. I have two approaches 🙂 but I need your advice.
1st approach: I would like to do the build and the releases + publish on the maven artifactory repo and then make a docker image from the maven release and publish on the docker artifactory repo. This allows you to make jars with maven and build an image from these jars. Am I good at my thinking? Then I wonder how to use the git repo with the Maven release part using gitflow?

2nd simpler approach: my deliverable is a docker image so I publish stable or unstable images on the docker repo. So starting from this principle I can do gitflow and ignore the versioning of my poms with maven. What do you think of this approach?

Source: Docker Questions