No, that won’t work. The contents of an image cannot directly be injected into the filesystem of a container created from another image.
Try this:
- Build an image which, when run, simply copies the jar to a path and exits.
- Use that image as as InitContainer in whichever pods need the jar. Mount a volume to the path to which the jar is copied.
- Now, mount the same volume in the container(s) defined in your main application podspecs, and ensure that the main application picks up the jar from there.