简体   繁体   中英

Docker update Jenkins container to image

I´m using a Docker Jenkins image, but I need to update the current version with some plugins. The idea is use the very same image in an environment where I dont have internet access so there´s no way I can add those plugins, so my idea was create a new image from the current container.

I read that is possible and I follow the steps:

Create new image

sudo docker commit CONTAINER_ID new_image_name

Run new image

sudo docker run --name cutom_image -p 8080:8080 -p 50000:50000 -e TERM=xterm -d new_image_name

But then when I connect by ssh to the container of the new updated image I cannot see any new installed plugin.

But when I see the size of the new image I can see that is a little bit bigger, so there´s must be some change.

Any idea what I´m doing wrong?

Regards.

The Jenkins/Jenkins docker image is normally run with:

docker run -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins/jenkins:lts

this will automatically create a 'jenkins_home' volume on docker host, that will survive container stop/restart/deletion.

If you commit the container, you do not commit the volume content associated with it.

Run your new image with the same options as your old image, and you will get back the same content (including the plugins subfolder)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM