[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [cbi-dev] Docker on Jenkins Dash
|
IIRC, the args "-u" you're giving to the Dockerfile pipeline is used to define which user is used inside the container, not how to to run docker. It does not relate to which user starts the docker command.
Unfortunately, Jenkins docker pipeline does not support this setup.
AFAIK, Glassfish uses Docker successfully in Dash JIPP, not through pipeline though.
So I would go with a non-docker agent and start the build step with a shell command calling the docker run command itself. Something like:
pipeline { agent { label 'glass-slave1' } stages { stage('Example Build') { steps { sh 'sudo docker run -it --rm -v ${WORKSPACE}:/build maven:3.5.3-jdk-8-slim mvn clean verify -f /build/pom.xml' } } } }
Cheers,
--
Mikaël Barbero - Eclipse Foundation IT Services - Release Engineering 📱 (+33) 642 028 039 🐦 @mikbarbero
Hi,
I’ve been trying hard to get some tests to run within a container in the Jenkins Dash environment.
The main road block is this error:
As seen, the container is unable to connect to Docker on the host. I then raised the following issue:
The Jenkins user has been given sudo access but that still doesn’t solve my problem since the docker commands are initiated by the Docker plugin. My script says just this:
pipeline {
agent {
docker { image 'maven:3.5.3-jdk-8-slim' }
} |
I tried all possible ways like passing args (-u root:sudo, -u 0:0) to above docker options. I also tried the dockerfile approach suspecting issue with the docker agent option, even that didn’t work:
agent { dockerfile { dir 'jenkins' args '-u root:root' label 'glass-slave1' } }
I can understand Jenkins user cannot be added to docker group for security reasons but is there any other way out? Has anyone been successful running jobs in containers on Eclipse Dash instances?
Thanks, -Yamini _______________________________________________ cbi-dev mailing list cbi-dev@xxxxxxxxxxxTo change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/cbi-dev
|
Attachment:
signature.asc
Description: Message signed with OpenPGP