| `jenkinsKubernetes` | no | `[jnlpAgent:s4sdk/jenkins-agent-k8s:latest]` | |
| `script` | yes | | |
| `sidecarEnvVars` | no | | |
| `sidecarImage` | no | | |
| `sidecarName` | no | | |
| `sidecarOptions` | no | | |
| `sidecarPullImage` | no | `true` | |
| `sidecarVolumeBind` | no | | |
| `sidecarWorkspace` | no | | |
| `stashContent` | no | | |
*`containerCommand` - Kubernetes only: Allows to specify start command for container created with dockerImage parameter to overwrite Piper default (`/usr/bin/tail -f /dev/null`).
*`containerPortMappings` - Map which defines per docker image the port mappings, e.g. `containerPortMappings: ['selenium/standalone-chrome': [[name: 'selPort', containerPort: 4444, hostPort: 4444]]]`.
*`containerShell` - Kubernetes only: Allows to specify the shell to be used for execution of commands.
*`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.
*`dockerName` - Kubernetes only: Name of the container launching `dockerImage`. SideCar only: Name of the container in local network.
*`dockerOptions` - Docker options to be set when starting the container (List or String).
*`dockerPullImage` - Set this to 'false' to bypass a docker image pull. Usefull during development process. Allows testing of images which are available in the local registry only.
*`dockerVolumeBind` - Volumes that should be mounted into the container.
*`dockerWorkspace` - Kubernetes only: Specifies a dedicated user home directory for the container which will be passed as value for environment variable `HOME`.
*`jenkinsKubernetes` -
*`script` - The common script environment of the Jenkinsfile running. Typically the reference to the script calling the pipeline step is provided with the this parameter, as in `script: this`. This allows the function to access the commonPipelineEnvironment for retrieving, for example, configuration parameters.
*`sidecarEnvVars` - as `dockerEnvVars` for the sidecar container
*`sidecarImage` - as `dockerImage` for the sidecar container
*`sidecarName` - as `dockerName` for the sidecar container
*`sidecarOptions` - as `dockerOptions` for the sidecar container
*`sidecarPullImage` - Set this to 'false' to bypass a docker image pull. Usefull during development process. Allows testing of images which are available in the local registry only.
*`sidecarVolumeBind` - as `dockerVolumeBind` for the sidecar container
*`sidecarWorkspace` - as `dockerWorkspace` for the sidecar container
*`stashContent` - Specific stashes that should be considered for the step execution.
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)