mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-01-18 05:18:24 +02:00
38 lines
1.3 KiB
Markdown
38 lines
1.3 KiB
Markdown
|
# dockerExecute
|
||
|
|
||
|
## Description
|
||
|
|
||
|
Executes a closure inside a docker container with the specified docker image.
|
||
|
The workspace is mounted into the docker image.
|
||
|
Proxy environment variables defined on the Jenkins machine are also available in the Docker container.
|
||
|
|
||
|
## Parameters
|
||
|
|
||
|
| parameter | mandatory | default | possible values |
|
||
|
| -------------------|-----------|-----------------------------------|----------------------------|
|
||
|
| `dockerImage` | no | '' | |
|
||
|
| `dockerEnvVars` | no | [:] | |
|
||
|
| `dockerOptions` | no | '' | |
|
||
|
| `dockerVolumeBind` | no | [:] | |
|
||
|
|
||
|
* `dockerImage` Name of the docker image that should be used. If empty, Docker is not used.
|
||
|
* `dockerEnvVars` Environment variables to set in the container, e.g. [http_proxy:'proxy:8080']
|
||
|
* `dockerOptions` Docker options to be set when starting the container.
|
||
|
* `dockerVolumeBind` Volumes that should be mounted into the container.
|
||
|
|
||
|
## Exceptions
|
||
|
|
||
|
None
|
||
|
|
||
|
## Example
|
||
|
|
||
|
```groovy
|
||
|
dockerExecute(dockerImage: 'maven:3.5-jdk-7'){
|
||
|
sh "mvn clean install"
|
||
|
}
|
||
|
```
|
||
|
|
||
|
|
||
|
|
||
|
|