mohamed-taman / Springy-Store-Microservices

Springy Store is a conceptual simple μServices-based project using the latest cutting-edge technologies, to demonstrate how the Store services are created to be a cloud-native and 12-factor app agnostic. Those μServices are developed based on Spring Boot & Cloud framework that implements cloud-native intuitive, design patterns, and best practices.

Home Page:https://mohamed-taman.github.io/Springy-Store-Microservices/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mavenize docker image build

mohamed-taman opened this issue · comments

As an Architect, I want to enhance the microservices dockerization by using a maven plugin, so that the docker image will be created automatically during the build process.

Requirements

  • use dockerfile-maven-plugin for more control with docker file Plugin Link.

  • Add IMAGE_VERSION and IMAGE_NAME arguments to be passed dynamically from the pom.xml file.

Hi Mohamed,

First, thanks for the project! I really like the idea of having a blueprint of how to do things and this looks really good. I like the idea of building the docker images with layers.

I see you solved the problem of when to run the docker plugin with properties. I also have some experience with activating plugins based on the project and I use profiles with activation based on present files. In this case I would add a profile which activates based on the presence of the Dockerfile.

Have you considered this approach?

For example:

        <profile>
            <id>modernizer</id>
            <activation>
                <file>
                    <exists>${maven.multiModuleProjectDirectory}/modernizer.marker</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.gaul</groupId>
                        <artifactId>modernizer-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>modernizer</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>modernizer</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

Hi @nickstolwijk
Thanks very much for your suggestion.

Can I ask you to open an issue for that explaining how it should work for our project:

  1. What to add in our project as dependencies,
  2. What will be inside the modernizer.marker,
  3. And the command line to run it.

So if it makes sense, I will assign it to you to collaborate and submit a pull request for such enhancement?

So what do you think?

I will try to make a PR to show what I mean.

This example was for another plugin, the modernizer plugin. The marker is just an empty file to indicate that the plugin (which is configured in the parent) should be activated.

My build is failing on log4j:log4j:jar:1.2.17-atlassian-1.

  • Where did you get this artifact?
  • Why do you still use log4j instead of SLF4j, Log4j 2 or Logback?