Jenkins Docker Pipelining inside Docker

0 votes

I'm following along with this tutorial:

https://www.linkedin.com/pulse/building-docker-pipeline-cloudbees-jenkins-jay-johnson

I'm running Jenkins on Docker 17:

docker run -d -p 8080:8080 -p 50000:50000 --name jenkins jenkins

I followed the instructions and replaced Jay's credentials with my own. I added my creds to Global and then renamed the creds in the pipeline script. When I attempt the build, though I'm getting the following error:

Proceeding
[Pipeline] withEnv
[Pipeline] {
[Pipeline] withDockerRegistry
Wrote authentication to /var/jenkins_home/.dockercfg
[Pipeline] {
[Pipeline] stage (Building)
Using the ‘stage’ step without a block argument is deprecated
Entering stage Building
Proceeding
[Pipeline] sh
[alfred-master] Running shell script
+ docker build -t jayjohnson/django-slack-sphinx:testing django
/var/jenkins_home/workspace/alfred-master@tmp/durable-713ce0d7/script.sh: 2: /var/jenkins_home/workspace/alfred-master@tmp/durable-713ce0d7/script.sh: docker: not found
[Pipeline] }
[Pipeline] // withDockerRegistry
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 127
Finished: FAILURE
Aug 1, 2018 in Docker by Hannah
• 14,080 points
188 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
The issue is here:

/var/jenkins_home/workspace/alfred-master@tmp/durable-713ce0d7/script.sh: 2: /var/jenkins_home/workspace/alfred-master@tmp/durable-713ce0d7/script.sh: docker: not found

I'm assuming your build is running on the master instance, which is just a basic installation of Jenkins - no extra tools.

You'll want to run an agent slave and connect it to your master - this agent should ensure it has Docker installed, and then you will be able to run those commands.
answered Aug 1, 2018 by Kalgi
• 35,720 points

Related Questions In Docker

0 votes
1 answer

Docker containers as Jenkins Slave build agents

When you encapsulate the stage inside a ...READ MORE

answered Jun 16, 2018 in Docker by Atul
• 10,190 points
484 views
0 votes
1 answer

Different file owner inside Docker container and in host machine Ask

Filesystems, at least in Unix- and Linux-like ...READ MORE

answered Jun 25, 2018 in Docker by Damon Salvatore
• 5,250 points
36 views
0 votes
1 answer

Different file owner inside Docker container and in host machine

Here is what you can try. Since ...READ MORE

answered Jun 27, 2018 in Docker by Atul
• 10,190 points
82 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
• 56,100 points
56 views
+2 votes
11 answers

How can I run a ‘docker exec’ command inside a docker container?

I guess there’s no docker runtime in ...READ MORE

answered 6 days ago in Docker by Frank
9,434 views
+4 votes
4 answers

How To Access a Service on Host From a Docker Container?

Adding to kalgi's answer, You can also ...READ MORE

answered Oct 16, 2018 in Docker by lina
• 8,100 points

edited Oct 16, 2018 by lina 1,926 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.