maven 批量docker_使用Maven Fabric8插件将多个Docker映像保存到一个tar.gz文件中

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

io.fabric8

docker-maven-plugin

0.27.2

. . .

Any help is greatly appreciated!

解决方案

You can save all images independly and then use maven assembly plugin to pack them in one file.

According to the documentation: you can save only one image in archive using this plugin. But you can execute docker:save for all needed images (it will create a few archives). And than assemble them.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值