Docker Cloud questions

23 views
Skip to first unread message

Vincent Massol

unread,
Feb 7, 2019, 6:24:14 AM2/7/19
to Jenkins Users
Hi guys,

I'm trying to use Docker cloud and I have 2 questions:

1) How can I debug the spawned docker agent container? 

I've found that by setting the "Docker Command" field in "Docker Agent Templates" > "Container Settings" I can have the container stopped but not removed. FTR I've put in this field:  "docker run -v /var/run/docker.sock:/var/run/docker.sock xwiki/xwiki-jenkins-slave"

However, what's strange is that I see in the job logs that the Jenkins workspace is located in /root/workspace (/root being the home dir of the root user), but when I start the stopped container with "docker start", there's nothing in /root

Is there some volume binding happening? I was also expecting "docker start" to restart any volume binding.

2) In my logs, I can see that I've set JAVA_HOME properly but when maven installs and starts it says it's not set:

➡ JAVA_HOME: /home/hudsonagent/java8
[Pipeline] echo
➡ Using Maven tool: Maven
[Pipeline] echo
➡ Using Maven options: -Xmx2048m -Xms512m
[Pipeline] echo
➡ Artifact archiving: false
[Pipeline] echo
➡ Dependencies fingerprinting: false
[Pipeline] withMaven
[withMaven] Options: [org.jenkinsci.plugins.pipeline.maven.publishers.GeneratedArtifactsPublisher[disabled=true], org.jenkinsci.plugins.pipeline.maven.publishers.DependenciesFingerprintPublisher[disabled=true, scopes=[compile, provided, runtime], versions={snapshot:true, release:false}]]
[withMaven] Available options: 
[withMaven] using JDK installation provided by the build agent
Unpacking https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip to /root/tools/hudson.tasks.Maven_MavenInstallation/Maven on Jenkins SSH Slave-000bzx6dkvokq on docker
[withMaven] using Maven installation 'Maven'
[Pipeline] {
[Pipeline] echo
➡ Using Maven goals: clean verify
[Pipeline] echo
➡ Using Maven profiles: docker,integration-tests
[Pipeline] echo
➡ Using Maven properties: 
[Pipeline] echo
➡ Using timeout: 240
[Pipeline] echo
➡ Java version used:
[Pipeline] sh
+ java -version
Picked up JAVA_TOOL_OPTIONS: -Dmaven.ext.class.path="/root/workspace/VincentDockerTest/master@tmp/withMavenf241505a/pipeline-maven-spy.jar" -Dorg.jenkinsci.plugins.pipeline.maven.reportsFolder="/root/workspace/VincentDockerTest/master@tmp/withMavenf241505a" 
openjdk version "1.8.0_202"
OpenJDK Runtime Environment Corretto-8.202.08.2 (build 1.8.0_202-b08)
OpenJDK 64-Bit Server VM Corretto-8.202.08.2 (build 25.202-b08, mixed mode)
[Pipeline] echo
➡ Current user:
[Pipeline] sh
+ whoami
root
[Pipeline] timeout
Timeout set to expire in 4 hr 0 min
[Pipeline] {
[Pipeline] echo
➡ Using POM file: pom.xml
[Pipeline] sh
+ mvn -f pom.xml clean verify -Pdocker,integration-tests --projects org.xwiki.platform:xwiki-platform-menu-test-docker -Dmaven.test.failure.ignore
----- withMaven Wrapper script -----
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
[Pipeline] }
[Pipeline] // timeout
[Pipeline] }
[Pipeline] // withMaven

Any idea?

Thanks
-Vincent

Vincent Massol

unread,
Feb 7, 2019, 10:38:19 AM2/7/19
to Jenkins Users
I can reply for point 2), this was a stupid mistake on my side.

I made JAVA_HOME point <java home>/bin/java ...

Still interested in the answer for point 1 though :)

Thanks
-Vincent
Reply all
Reply to author
Forward
0 new messages