[Pipeline] withDockerContainer Jenkins does not seem to be running inside a container

+4 votes

Hi Team,

I am getting an error while running the Jenkins file tp build and push the docker image into docker hub .

you can reveiw my code github : https://github.com/iakshaykr/webapp.git (using jenkins_pipe branch not master branch )

Jenkinsfile : 

pipeline {
    environment {
        registry= "iakshaykr/webapp"
        registryCredential= 'dockerhub'
    }

    agent { dockerfile true }

    stages {
        stage('Bilding image') {
            steps {
             script {
                 docker.build registry + ":$BUILD_NUMBER"
              }
            }
        }
    }
}

Nov 9, 2019 in Jenkins by Akshay
• 160 points
2,673 views
Have you installed docker, docker plugin/docker pipeline on the latest version? Also make sure to add the installation root path in the configuration tool!

1 answer to this question.

+1 vote
Hey @Karan, I just missed out on adding the installation root path in config tool. Once I did that, it worked like a charm.

Thanks a lot.

@Akshay, try out @Karan's workaround, might help.
answered Nov 14, 2019 by Eric
how to add? sorry i really new on this stuff
Go to Manage jenkins->Global tool configuration->docker and set installation root path there.
you mean /usr/bin/docker
I think it's /var/lib/docker

Related Questions In Jenkins

+1 vote
1 answer
0 votes
0 answers

Developing Continuous Delivery Pipeline using Git, Jenkins, Maven & Tomcat - join link. Registered today but not geeting link to joinin

Developing Continuous Delivery Pipeline using Git, Jenkins, ...READ MORE

Jul 4, 2019 in Jenkins by Mukul

closed Jul 5, 2019 by Vardhan 373 views
0 votes
1 answer
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 57,700 points
842 views
+2 votes
5 answers
+3 votes
2 answers

How to trigger a Jenkins pipeline A in another Jenkins pipeline B?

If you are talking about executing another ...READ MORE

answered Jul 31, 2019 in Jenkins by Sirajul
• 58,130 points
30,782 views