skip to Main Content

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


  1. 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.

    Login or Signup to reply.
  2. 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

    docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]
    

    So if your container is called mycontainer, your repository is myrepository and you want to call the image myjenkins, you’d do

    docker commit mycontainer myrepository/myjenkins:latest
    

    and then push it to the repository using

    docker push myrepository/myjenkins:latest
    

    Then, on your other machine, you can pull it and run it.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search