Docker build in Jenkins

When running job with Docker build and publish I get exception Please find the exception below

git config core.sparsecheckout # timeout=10
git checkout -f 82bb778d55f0a9a5020c23aa5dfa62db79de2e28
git rev-list 82bb778d55f0a9a5020c23aa5dfa62db79de2e28 # timeout=10 [example]

  • How to access tomcat docker container running in VMWare workstation?
  • Running composer install in docker container
  • Monitoring node processes within docker containers
  • How can I use own located folders as volumes in docker artifactory container?
  • Replacing sbt-native-packager with sbt-docker in Scala Play
  • What are the differences between Kubernetes Pods and Docker Compose(s) (Composures?)
  • $ docker build -t adithi11/demo-example:v9 –pull=true /Users/Shared/Jenkins/Home/workspace/example

    ERROR: Cannot run program "docker" (in directory "/Users/Shared/Jenkins/Home/workspace/example"): error=2, No such file or directory Cannot run program "docker" (in directory "/Users/Shared/Jenkins/Home/workspace/example"): error=2, No such file or directory
        at java.lang.ProcessBuilder.start(
        at hudson.Proc$LocalProc.<init>(
        at hudson.Proc$LocalProc.<init>(
        at hudson.Launcher$LocalLauncher.launch(
        at hudson.Launcher$ProcStarter.start(
        at com.cloudbees.dockerpublish.DockerBuilder$Perform.executeCmd(
        at com.cloudbees.dockerpublish.DockerBuilder$Perform.executeCmd(
        at com.cloudbees.dockerpublish.DockerBuilder$Perform.buildAndTag(
        at com.cloudbees.dockerpublish.DockerBuilder$Perform.exec(
        at com.cloudbees.dockerpublish.DockerBuilder$Perform.access$100(
        at com.cloudbees.dockerpublish.DockerBuilder.perform(
        at hudson.tasks.BuildStepMonitor$1.perform(
        at hudson.model.AbstractBuild$AbstractBuildExecution.perform(
        at hudson.model.Build$
        at hudson.model.Build$BuildExecution.doRun(
        at hudson.model.AbstractBuild$
        at hudson.model.Run.execute(
        at hudson.model.ResourceController.execute(
    Caused by: error=2, No such file or directory
        at java.lang.UNIXProcess.forkAndExec(Native Method)
        at java.lang.UNIXProcess.<init>(
        at java.lang.ProcessImpl.start(
        at java.lang.ProcessBuilder.start(
        ... 19 more
    Build step 'Docker Build and Publish' marked build as failure
    Finished: FAILURE

    But when i sudo to jenkins I get this

    sudo su jenkins
    docker images
    Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.25/images/json: dial unix /var/run/docker.sock: connect: permission denied

    Would appreciate your assistance

  • Issues accessing Sinatra app in Docker container
  • Docker port bindings
  • Need help regarding ECS service in AWS
  • Make one Docker Compose service know the domain name of another
  • docker: how to do/setup networking container-to-host for udp / snmp
  • Unable to start jenkins auctomatically inside docker container
  • One Solution collect form web for “Docker build in Jenkins”

    # Add the docker group if it doesn't already exist.
    $ sudo groupadd docker
    # Add jenkins user to docker group. 
    $ sudo gpasswd -a jenkins docker
    # Restart the Docker daemon.
    $ sudo service docker restart

    Logout and login again for the changes to apply

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.