现在有这样一个需求,在一个 java 项目的源码根目录下增加一个 Dockerfile 文件,先把项目打包成一个完整的压缩包 your-app-bin.zip(包含 bin、config、lib 等目录),再把压缩包 your-app-bin.zip 和 Dockerfile 文件一起打包成另一个压缩包 your-app-docker.zip(your-app-bin.zip 和 Dockerfile 文件平级)。
因项目使用 maven 管理,并使用 maven-assembly-plugin 打包。可以在项目 pom.xml 中 maven-assembly-plugin 的配置下增加第二个打包配置文件。