1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-16 11:09:33 +02:00
sap-jenkins-library/documentation/docs/steps/dockerExecute.md

1.4 KiB

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. It can be a list or a string.
  • dockerVolumeBind Volumes that should be mounted into the container.

Step configuration

None

Exceptions

None

Example

dockerExecute(dockerImage: 'maven:3.5-jdk-7'){
    sh "mvn clean install"
}