Allow overriding number of executors
diff --git a/jenkins.sh b/jenkins.sh
index df1531d..a717795 100755
--- a/jenkins.sh
+++ b/jenkins.sh
@@ -5,6 +5,11 @@
 echo "--- Copying files at $(date)" >> "$COPY_REFERENCE_FILE_LOG"
 find /usr/share/jenkins/ref/ -type f -exec bash -c ". /usr/local/bin/jenkins-support; copy_reference_file '{}'" \;
 
+cat << EOF >>/usr/share/jenkins/ref/init.groovy.d/executors.groovy
+import jenkins.model.*
+Jenkins.instance.setNumExecutors(${JENKINS_NUM_EXECUTORS:-2})
+EOF
+
 # if `docker run` first argument start with `--` the user is passing jenkins launcher arguments
 if [[ $# -lt 1 ]] || [[ "$1" == "--"* ]]; then
   eval "exec java $JAVA_OPTS -jar /usr/share/jenkins/jenkins.war $JENKINS_OPTS \"\$@\""