SOLVED Running custom docker image

rmvanderspek

Dabbler
Joined
Apr 12, 2022
Messages
13
I'm running TrueNAS-SCALE-22.02.4
I have several application running using the truecharts. All applications run as expected.

Now I'm running into some issues trying to run a custom docker image. It's an image that contains a java app (jar) which should be booted on startup. (java -jar /usr/share/jenkins/agent.jar). Unfortunately I keep getting an error in the deploy stage:

2022-11-30 08:21:55.941605+00:00Unrecognized option: -jar /usr/share/jenkins/agent.jar
2022-11-30 08:21:55.941810+00:00Error: Could not create the Java Virtual Machine.
2022-11-30 08:21:55.941823+00:00Error: A fatal exception has occurred. Program will exit.

When I change the Container Args for '-version', I do get the java version output, so the command seems to be working when it only has one arg. Anyone know what I am doing wrong here?

  • Application Name: jenkins-agent
  • Version: 2208.0.0
  • Docker Image:
    • Image repository: jenkins/agent
    • Image Tag: latest
    • Image Pull Policy: Only pull image if not present on host
  • Container CMD: java
  • Container Args: -jar /usr/share/jenkins/agent.jar
  • DNS Policy: Use Default DNS Policy where Pod will inherit the name resolution configuration from the node.
  • Provide access to node network namespace for the workload: false
  • Host Path Volumes: 1
  • Enable TTY: false
  • Enable STDIN: false
  • Security Context:
    • Privileged Mode: false
    • Configure Container User and Group ID: false
  • Update Strategy: Create new pods and then kill old ones
  • GPU Configuration:
    • GPU Resource (amd.com/gpu): Allocate 0 amd.com/gpu GPU
  • Enable Pod resource limits: false
  • Enable WebUI Portal (only supported in TrueNAS SCALE Bluefin): false
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Are you 100% certain that there is a file in the container in that exact path? I guess that might be the cause of the exception if it's not there.
 

rmvanderspek

Dabbler
Joined
Apr 12, 2022
Messages
13
Yes, I'm 100% sure that image has that file on that location. Further more, it is the '-jar' that is not being recognized as an option by java. This is 'impossible' since this is a valid and much used option in java. The reason I'm getting that error message is probably because the CMD and ARG are not being parsed the way I expect them to be. (Maybe with an extra space, or escape characters.)
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Have you tried encapsulating in single or double quotes?
 

rmvanderspek

Dabbler
Joined
Apr 12, 2022
Messages
13
Yes, both not working. Thanks for the suggestion though, had not tried single quotes.

Any ideas for debugging? It's quite hard to do any troubleshooting if the deployment fails :-(
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Maybe changing the command to bash (with the appropriate path) and then using the shell option to get interactive with the container will help.

Otherwise try looking at the logs (I know it's hard as they clear when the container is destroyed).
 

rmvanderspek

Dabbler
Joined
Apr 12, 2022
Messages
13
Thanks Stretalla, I managed to debug it by using 'sleep' as command and 60m as args. I still don't know why using the command line didn't work, but I now created an init shellscript to get things going.

I'm now getting different issues, but I'll open another question for that, since this one is solved.
 
Top