Here's a pipeline that reproduces the bug:
Here's the output:
from groovy: $string$with$dollars
from sh: $$string$$with$$dollars
Note that all the dollar signs have been doubled! Note that we've included a call to env, which prints the same incorrect string, so that we can eliminate the possibility of groovy string interpolation issues.
We isolated the problem to the container() function. The bug does not occur with this version of the code, where it is removed, despite that the exact same container (jnlp) is actually used: