It should be possible, and much preferable, to pass these as actual environment variables in the container.
However, when I did this using the withEnv step they were not picked up by the script. (I have no idea why, and it's possible I may just have done something wrongly.)
We currently have an unpleasant hack which creates a .env file in order to pass the required environment variables to the moodle-plugin-ci script: https://github.com/University-of-Strathclyde-LTE-Team/moodle-plugin-ci-jenkins/blob/v0.4.1/vars/withMoodlePluginCiContainer.groovy#L123
It should be possible, and much preferable, to pass these as actual environment variables in the container.
However, when I did this using the withEnv step they were not picked up by the script. (I have no idea why, and it's possible I may just have done something wrongly.)