I\'m using the declarative pipeline syntax to do some CI work inside a docker container.
I\'ve noticed that the Docker plugin for Jenkins runs a container using the
if you have admin access to Jenkins you can add these two script approvals:
staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods execute java.lang.String
staticMethod org.codehaus.groovy.runtime.ProcessGroovyMethods getText java.lang.Process
in this URI: http://${jenkins_host:port}/jenkins/scriptApproval/
which will allow you to execute a shell command in the master in this way:
def user = 'id -u'.execute().text
node {
echo "Hello World ${user}"
}