*`script` defines the global script environment of the Jenkinsfile run. Typically `this` is passed to this parameter. This allows the function to access the [`commonPipelineEnvironment`](commonPipelineEnvironment.md) for storing the measured duration.
*`containerPortMappings`: Map which defines per docker image the port mappings, like `containerPortMappings: ['selenium/standalone-chrome': [[name: 'selPort', containerPort: 4444, hostPort: 4444]]]`
*`dockerEnvVars`: Environment variables to set in the container, e.g. [http_proxy:'proxy:8080']
*`dockerImage`: Name of the docker image that should be used. If empty, Docker is not used and the command is executed directly on the Jenkins system.
*`dockerWorkspace`: only relevant for Kubernetes case: specifies a dedicated user home directory for the container which will be passed as value for environment variable `HOME`
*`sidecarEnvVars` defines environment variables for the sidecar container, similar to `dockerEnvVars`
*`sidecarImage`: Name of the docker image of the sidecar container. Do not provide this value if no sidecar container is required.
*`sidecarName`: as `dockerName` for the sidecar container
*`sidecarOptions`: as `dockerOptions` for the sidecar container
*`sidecarVolumeBind`: as `dockerVolumeBind` for the sidecar container
*`sidecarWorkspace`: as `dockerWorkspace` for the sidecar container
If the Jenkins is setup on a Kubernetes cluster, then you can execute the closure inside a container of a pod by setting an environment variable `ON_K8S` to `true`. However, it will ignore `containerPortMappings`, `dockerOptions` and `dockerVolumeBind` values.
In the above example, the `dockerEcecute` step will internally invoke [dockerExecuteOnKubernetes](dockerExecuteOnKubernetes.md) step and execute the closure inside a pod.
## Example 3: Run closure inside a container which is attached to a sidecar container (as for example used in [seleniumExecuteTests](seleniumExecuteTests.md):