run a pipeline in a jenkins docker-agent by jenkins slave

0 votes
hi,
I know we can use a docker to run a pipeline inside a docker container, also I know that I can use a VM as a Jenkins slave/agent. The question is how can I run a pipeline inside a VM slave where this pipeline creates a Docker-Jenkins agent and execute the pipeline inside it.
Jul 6, 2020 in Jenkins by nemer
• 120 points

edited Jul 7, 2020 by MD 2,393 views

1 answer to this question.

0 votes

Hi@nemer,

You can do your task in multiple ways. One way is you can create one cloud node dynamically in your VM with the help of a Docker image. It will give you one Jenkins container. In the same Job, you can create one Pipeline script and it will run in the same environment.

answered Jul 7, 2020 by MD
• 95,440 points

Related Questions In Jenkins

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,610 points
3,286 views
+1 vote
1 answer
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,654 views
+2 votes
1 answer

How to run a job in Jekins by a different user ?

To run a job by a specific ...READ MORE

answered Jun 17, 2019 in Jenkins by Neel
• 3,020 points
26,640 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,090 points
2,435 views
+5 votes
3 answers

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

You can run the following code, its ...READ MORE

answered Jul 5, 2018 in Jenkins by Sophie may
• 10,610 points
117,124 views
0 votes
1 answer

is there a way how to finish in-progress slave builds if Jenkins master goes offline

Hi@, You can assign your Jenkins Job to ...READ MORE

answered Jun 30, 2020 in Jenkins by MD
• 95,440 points
3,172 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