pull and run pushed docker image

+1 vote
Hi,

I'm building a docker image using an jenkins pipeline and push it into docker registry, now i want to pull and run this image in other remote server. I am not sure this step (pull&run) must be in jenkis pipline and how.

thanks
Feb 25 in Jenkins by anonymous
• 130 points
121 views

1 answer to this question.

0 votes

Let's break this into 2 stages:
Stage 1 - Image generation & Upload Image
Stage 2 - Create container using newly created image

Stage 1: This can be achieved in many ways:

  • Try to write a shell/python script which would use docker native commands like 'docker build' to generate Image & 'docker push' to push to the registry

  • Try using 'docker.withRegistry' Jenkins scripted directive to create Image & push Image in one step

Stage 2:  By default when you try to create the container Docker would download the Image from the specified Docker Registry, so once you have uploaded the image in the previous stage to Registry, use any of your interested steps using docker native cmds or script or pipeline to create the container by specifying the correct Image path i.e 

<UR-DOCKER-REGISTRY>/<UR-REPO>/<UR-IMAGE>:<UR-TAG> 

and it will download the Image on the machine where u r running it, then the container will run !!

answered Feb 25 by Adam

Related Questions In Jenkins

0 votes
2 answers
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,940 points
594 views
0 votes
5 answers
+1 vote
1 answer

how to install jenkins and how to run pom.xml through jenkins

The complete process to install Jenkins can be ...READ MORE

answered Feb 12, 2019 in Jenkins by Kalgi
• 51,830 points
4,385 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,530 points
447 views
0 votes
1 answer

Jenkins and Docker: How can I customize my jenkins pipeline to use docker?

Jenkins Pipeline is designed to easily use ...READ MORE

answered Aug 26, 2019 in Jenkins by Sirajul
• 50,440 points
395 views
+4 votes
7 answers

How to set the pipeline name and description for a Jenkinsfile?

You can rename pipeline jobs in jenkins ...READ MORE

answered Oct 11, 2018 in Jenkins by Hannah
• 18,030 points
12,510 views