0

I have a spring-boot project with the following structure

enter image description here

I am using gradle and using the jib plugin to build my docker image.

jib plugin version:

id 'com.google.cloud.tools.jib' version '3.1.2'

I am using the jib plugin to copy all contents of the newrelic folder into the /app/libs/newrelic folder then later setting it as the java agent on line 131.

The problem is when I build this image with jib 'jibDockerBuild', the process is successful, the files seem to be copied but when I start start any container from this image, I get an error

Error opening zip file or JAR manifest missing : /app/libs/newrelic/newrelic.jar
Error occurred during initialization of VM
agent library failed to init: instrument

I have tred to look at the files in the container and this path exists and the jar also exists in the directory:

using docker export -o dump.tar 13a92d2f193d

then tar -tvf dump.tar

I can see the files in the container :

enter image description here

Could there be something I am missing in the setup?

IsaacK
  • 1,178
  • 1
  • 19
  • 49

1 Answers1

3

The screenshot shows that the size of /app/libs/newrelic/newrelic.jar is zero. Check the JAR file on your local filesystem and make sure that you have a valid one.

Chanseok Oh
  • 3,920
  • 4
  • 23
  • 63
  • Thanks once again Mr. @Chanseok, I lost 2 days with a corrupt file. The extra eyes much appreciated. – IsaacK Sep 15 '21 at 08:02