I am running a plugin on my local machine with this command:
mvn hpi:run
My repository contains a Jenkinsfile which runs a docker image to build a
latex document.
Jenkinsfile looks like:
pipeline {
agent none
stages {
stage('Build') {
agent {
docker {
image 'blang/latex:ubuntu'
}
}
steps {
sh 'xelatex sample.tex'
}
}
}
}
Since the Jenkins instance is running on my local machine and in my local
machine docker is installed for the root user only so I need a way to
execute the Jenkinsfile with sudo permission.
I recieve an error like this:
+ docker pull blang/latex:ubuntu
Got permission denied while trying to connect to the Docker daemon socket
at unix:///var/run/docker.sock: Post
http://%2Fvar%2Frun%2Fdocker.sock/v1.39/images/create?fromImage=blang%2Flatex&tag=ubuntu:
dial unix /var/run/docker.sock: connect: permission denied
script returned exit code 1
Can anyone suggest a way how I can run docker with root permission inside
the Jenkins pipeline?
--
You received this message because you are subscribed to the Google Groups
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-dev/b0106f8f-fa09-4dc7-98a3-f7bdff9f0d6f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.