fabric8io / docker-maven-plugin

Maven plugin for running and creating Docker images
https://dmp.fabric8.io
Apache License 2.0
1.88k stars 642 forks source link

Question - Save Multiple docker images into one tar.gz file with maven fabric8 plugin #1261

Open dinbtechit opened 5 years ago

dinbtechit commented 5 years ago

We are using io.fabric8:docker-maven-plugin:0.27.2 to build docker images.

my maven project consist of 3 modules (module1, module2 and module3). Each module builds a docker image based on the dockerfile present within each module.

Now, when I run mvn docker:save - I want to save all 3 docker images into one tar.gz file, myproject-1.0.0.tar.gz. Is it even possible with this plugin?

My Project Structure:

project
|-module1
  |-DockerFile1
  |-pom.xml
|-module2
  |-DockerFile2
  |-pom.xml
|-module3
  |-DockerFile3
  |-pom.xml
|-pom.xml

I'm using io.fabric8:docker-maven-plugin:0.27.2

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

Any help is greatly appreciated!

vindiagram commented 2 years ago

This has never been answerd. Is such a capability planned or possible to create a multi-image tar ball

rhuss commented 2 years ago

This is currently not possible and there are no plans to implement this, but if someone wants to pick this up, it should be possible to integrate as it looks like a straightforward and useful extension. However, I'm not sure if the implementation is easy as this involves looking into sub-projects and for now (except for configuration inheritance) there is no such dependency and each project is independent of others.