I start using the CloudBees docker build environment plugin a couple of weeks ago and all was going well until I install the EnvInject plugin. After installing the plugin my shell build step can't find ls (or npm or a number of other things which are in the container)
/tmp/hudson4662764981604235729.sh: line 2: ls: command not found
Build step 'Execute shell' marked build as failure
After uninstalling the EnvInject plugin, all works again.
The problem occurs in the build when the EnvInject plugin options are not being used. I'm glad I don't have to have the EnvInject plugin
Not sure this is feasible, as the docker container environment is set when container is started, and subsequent commands ran with `docker exec` can't amend it.
Can't you set environment before checkout ? What's your use-case ?