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,310 points
5,758 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
answered Aug 5, 2018 by Sophie may
• 9,870 points
0 votes
answered Jan 31 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 22 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 22 by Sameer
0 votes
Check if you have Docker installed and let me know.
answered Apr 22 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 in Jenkins by Bishu
1,156 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,620 points
357 views
+1 vote
1 answer

Error: Maven runs with the wrong JDK on Jenkins

Perform the following steps: 1) Navigate to Manage ...READ MORE

answered Aug 8, 2018 in Jenkins by Sophie may
• 9,870 points
776 views
0 votes
1 answer
0 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,300 points
270 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
• 9,870 points
370 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
• 9,870 points
518 views