I am new to using docker.
I have pulled an image for Jenkins from the docker repository and made some changes in the Jenkins server that has been deployed via docker.
Currently this container is running on my machine,and I want run this Jenkins image with my changes on a seperate machine as well.
Is it possible to push my snapshot of the Jenkins images to some repo and then pull it on a different machine and run it there as well?
Thanks in advance
2
Answers
You can use
docker commit
to generate a new image that includes any modifications made in the container. You can then push that image like normal.You should really make your image by creating a Dockerfile that makes the changes you need. That way, you can easily do it again when an updated Jenkins image comes out.
That being said, it is possible to create an image from a running container using
So if your container is called
mycontainer
, your repository ismyrepository
and you want to call the imagemyjenkins
, you’d doand then push it to the repository using
Then, on your other machine, you can pull it and run it.