diff --git a/Jenkinsfile b/Jenkinsfile index 4427fce26ce..e91aff9114e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ def baseTests(String image) { Map base_tests = [failFast: false]; base_tests['Unit Tests CTest'] = { - docker.image(image) { + withDockerContainer(args: '-u root', image: image) { stage('Setup CTest') { echo 'Nothing to be done.'; } @@ -27,7 +27,7 @@ def baseTests(String image) { base_tests['Unit Tests Tcl'] = { node { - docker.image(image) { + withDockerContainer(args: '-u root', image: image) { stage('Setup Tcl Tests') { sh label: 'Configure git', script: "git config --system --add safe.directory '*'"; checkout scm; @@ -68,7 +68,7 @@ def baseTests(String image) { flow_tests.each { current_test -> base_tests["Flow Test - ${current_test}"] = { node { - docker.image(image) { + withDockerContainer(args: '-u root', image: image) { stage("Setup ${current_test}") { sh label: 'Configure git', script: "git config --system --add safe.directory '*'"; checkout scm; @@ -104,7 +104,7 @@ def getParallelTests(String image) { 'Build without GUI': { node { - docker.image(image) { + withDockerContainer(args: '-u root', image: image) { stage('Setup no-GUI Build') { echo "Build without GUI"; sh label: 'Configure git', script: "git config --system --add safe.directory '*'"; @@ -121,7 +121,7 @@ def getParallelTests(String image) { 'Build without Test': { node { - docker.image(image) { + withDockerContainer(args: '-u root', image: image) { stage('Setup no-test Build') { echo "Build without Tests"; sh label: 'Configure git', script: "git config --system --add safe.directory '*'"; @@ -148,7 +148,7 @@ def getParallelTests(String image) { 'Unit Tests Ninja': { node { - docker.image(image).inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') { + withDockerContainer(args: '-u root', image: image) { stage('Setup Ninja Tests') { sh label: 'Configure git', script: "git config --system --add safe.directory '*'"; checkout scm; @@ -174,7 +174,7 @@ def getParallelTests(String image) { 'Compile with C++20': { node { - docker.image(image).inside('--user=root --privileged -v /var/run/docker.sock:/var/run/docker.sock') { + withDockerContainer(args: '-u root', image: image) { stage('Setup C++20 Compile') { sh label: 'Configure git', script: "git config --system --add safe.directory '*'"; checkout scm;