Skip to content

Commit 5639158

Browse files
committed
Enable Jenkins CI build to fork Docker Containers (due to the use of Testcontainers) inside Docker.
Resolves spring-projectsgh-1170.
1 parent 681fc41 commit 5639158

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Jenkinsfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pipeline {
5050
steps {
5151
script {
5252
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
53-
docker.image('springci/spring-data-openjdk17-cassandra-3.11:latest').inside('-v $HOME:/tmp/jenkins-home') {
53+
docker.image('springci/spring-data-openjdk17-cassandra-3.11:latest').inside('-u root -v /usr/bin/docker:/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock -v $HOME:/tmp/jenkins-home') {
5454
sh 'mkdir -p /tmp/jenkins-home'
5555
sh 'JAVA_HOME=/opt/java/openjdk /opt/cassandra/bin/cassandra -R &'
5656
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,external-cassandra clean dependency:list verify -Dsort -U -B'
@@ -79,7 +79,7 @@ pipeline {
7979
steps {
8080
script {
8181
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
82-
docker.image('adoptopenjdk/openjdk17:latest').inside('-v $HOME:/tmp/jenkins-home') {
82+
docker.image('adoptopenjdk/openjdk17:latest').inside('-u root -v /usr/bin/docker:/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock -v $HOME:/tmp/jenkins-home') {
8383
sh 'mkdir -p /tmp/jenkins-home'
8484
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,artifactory ' +
8585
'-Dartifactory.server=https://repo.spring.io ' +
@@ -111,7 +111,7 @@ pipeline {
111111
steps {
112112
script {
113113
docker.withRegistry('', 'hub.docker.com-springbuildmaster') {
114-
docker.image('adoptopenjdk/openjdk17:latest').inside('-v $HOME:/tmp/jenkins-home') {
114+
docker.image('adoptopenjdk/openjdk17:latest').inside('-u root -v /usr/bin/docker:/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock -v $HOME:/tmp/jenkins-home') {
115115
sh 'mkdir -p /tmp/jenkins-home'
116116
sh 'MAVEN_OPTS="-Duser.name=jenkins -Duser.home=/tmp/jenkins-home" ./mvnw -s settings.xml -Pci,distribute ' +
117117
'-Dartifactory.server=https://repo.spring.io ' +

0 commit comments

Comments
 (0)