0

Jib handles all steps of packaging (handles compilation, verification and building the project) your application into a container. However I want to build the jar separately and and provide this jar as a input to JIB to create a docker image and publish to nexus repository. Is there any way to use JIB only for creating a docker image from the given jar?

Priyanka
  • 13
  • 5
  • What’s the point? The main power of JIB is that it can layer your application into docker to maximise cache reuse. If you’re just shoving a jar into a container just use a Dockerfile… – Boris the Spider Aug 25 '21 at 05:15
  • We are already using JIB instead of a docker file in all of the projects. I need the above functionality only in few projects where I obfuscate the application code first, create a jar and then create a docker image out of that jar.. – Priyanka Aug 25 '21 at 05:42
  • If you’re just obfuscating code, why do you need to create a jar? Just create the image out of the obfuscated code. Or are you running the obfuscator over your libraries too and packaging a fat jar? – Boris the Spider Aug 25 '21 at 06:35

1 Answers1

2

You may want to look into the 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