Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify configuration #957

Closed
rhuss opened this issue Feb 27, 2018 · 2 comments
Closed

Simplify configuration #957

rhuss opened this issue Feb 27, 2018 · 2 comments
Assignees
Labels

Comments

@rhuss
Copy link
Collaborator

rhuss commented Feb 27, 2018

When only a single image should be build with a Dockerfile, the current configuration syntax has too much boilerplate.

E.g.

<plugin>
  <groupId>io.fabric8</groupId>
  <artifactId>docker-maven-plugin</artifactId>        
  <configuration>
    <images>
      <image>
        <name>${project.groupId}/${project.artifactId}:${project.version}</name>
        <build>
          <dockerFile>Dockerfile</dockerFile>
        </build>
      <image>
    </images>
  </configuration>
</plugin>

should be possible with

<plugin>
  <groupId>io.fabric8</groupId>
  <artifactId>docker-maven-plugin</artifactId>        
</plugin>

when a single Dockerfile in the base directory (or src/main/docker). The image name defaults to ${project.groupId}/${project.artifactId}:${project.version} then, but can be configured with a global imageName.

Also think about a compatibility mode for the configuration syntax of https://github.com/spotify/docker-maven-plugin or https://github.com/spotify/dockerfile-maven

@rhuss rhuss added the feature label Feb 27, 2018
@rohanKanojia
Copy link
Member

Hi @rhuss ,
I would like to work on this. Could you please give me code pointers related to this?

@rhuss
Copy link
Collaborator Author

rhuss commented Feb 28, 2018

@rohanKanojia awesome, thanks ;-)

A good starting point is the class ImageConfiguration and how it is used in BuildMojo.executeInternal(). I would add a check, whether the ImageConfiguration is empty and then build up one dynamically with the given defaults (and when a Dockerfile exists in either src/main/docker or top-level in the project dir).

@rohanKanojia rohanKanojia self-assigned this Mar 6, 2018
rohanKanojia added a commit to rohanKanojia/docker-maven-plugin that referenced this issue Mar 9, 2018
When only a single image is build with Dockerfile, no need to provide
too much parameters in configuration; build ImageConfiguration dynamically
with the given defaults.
@rhuss rhuss closed this as completed in 3a1e6ba Mar 18, 2018
rhuss added a commit that referenced this issue Mar 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants