有什么方法可以仅使用 JIB 从给定的 jar 创建 docker 图像?

Is there any way to use JIB only for creating a docker image from the given jar?

Jib 处理将您的应用程序打包(处理编译、验证和构建项目)到容器中的所有步骤。但是,我想单独构建 jar,并将此 jar 作为 JIB 的输入提供,以创建 docker 图像并发布到 nexus 存储库。 有什么方法可以仅使用 JIB 从给定的 jar 创建 docker 图像?

您可能需要查看 Jib CLI. The jib cli jar command is powered by jib-core and lets you build an optimized image from a JAR file. You can find more info on how it works in the FAQ and the README