Error Docker not found when building docker image on Jenkins pipeline

0 votes

My Jenkins is running as a docker container and I’m building a Docker image using the pipeline. But I always get an error which says ‘Docker not found’.

[simple-tdd-pipeline] Running shell script
+ docker build -t simple-tdd .
/var/jenkins_home/workspace/simplepp/durable-
aec35159/script.sh: 2: /var/jenkins_home/workspace/simplepp/
durable-aec35159/script.sh: docker: not found
Aug 5, 2018 in Jenkins by Tyrion anex
• 8,700 points
23,494 views

5 answers to this question.

0 votes

This happens when docker client is not installed. Install it in a Dockerfile, just follow the below script:

RUN curl -fsSLO https://get.docker/builds/Linux/x86_64/docker-17.04.0-ce.tgz \
  && tar xzvf docker-17.04.0-ce.tgz \
  && mv docker/docker /usr/local/bin \
  && rm -r docker docker-17.04.0-ce.tgz

Ready to level up your Docker skills? Enroll now in our comprehensive Docker Course!

answered Aug 5, 2018 by Sophie may
• 10,620 points
0 votes
answered Feb 1, 2019 by anonymous
Couldn't find the sol here TBH. Am i missing the obvious? :O
0 votes

I had the same issue, I had to run Jenkins in privileged mode.

answered Apr 23, 2019 by Ishaan
0 votes

There is a high possibility that you're missing the obvious. Install docker, probably docker isn't installed at all. Use the following command to install it:

sudo apt-get install docker.io
answered Apr 23, 2019 by Sameer
0 votes
Check if you have Docker installed and let me know.
answered Apr 23, 2019 by Vimal
I have a similar issue. How do I check if Docker is installed?

Execute the following command and let me know the output

dpkg -l | grep docker

I got this:

docker - System tray for KDE3/GNOME2 docklet applications

You do not have docker installed. The following package is an invalid one. Download docker. 

Have a look at this thread!

Related Questions In Jenkins

0 votes
1 answer

Use a docker image with jenkins declarative pipeline

Hey @Jithin, you could use something like ...READ MORE

answered Apr 12, 2019 in Jenkins by Bishu
4,928 views
0 votes
2 answers
0 votes
1 answer

Access Error: 404 -- Not Found in jenkins.

Hi@akhtar, You may get this error if port ...READ MORE

answered Jun 16, 2020 in Jenkins by MD
• 95,460 points
7,080 views
0 votes
1 answer

How to rebuild an item on Jenkins pipeline

Yes you can, its pretty simple actually. Go ...READ MORE

answered Jul 10, 2018 in Jenkins by Kalgi
• 2,680 points
4,268 views
+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
• 58,020 points
2,714 views
0 votes
1 answer

I’m facing a login error when I try to run Jenkins on Docker. How do I solve this?

You have to open the /var/log/jenkins/jenkins.log file to ...READ MORE

answered Jul 24, 2018 in Jenkins by Sophie may
• 10,620 points
3,575 views
0 votes
1 answer

Jenkins docker-compose error

You must install docker-compose in order to run ...READ MORE

answered Jul 24, 2018 in Jenkins by Sophie may
• 10,620 points
2,483 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP