Docker Community Forums

Share and learn in the Docker community.

Committed image does not contain the add-on's

(Mcetin) #1


i created an image from a base image using docker commit but when i connect to the container for the new image i don’t see the stuff i had added onto the base. the image size is bigger than base so i am guessing it must have the content. what might i be missing?


(David Maze) #2

I would recommend scripting this procedure: write a Dockerfile that starts FROM whatever base image, then RUN the commands to add things to the image (or COPY in new content), and then you can reproducibly docker build it.

Can you say any more about what you’re doing, maybe what the specific output you get from docker commit is and what docker run command you do afterwards?

(Mcetin) #3

So, I started out with a base jenkins image. I configured it by adding a number of plugins, adding a pipeline script, configured it for git and maven, and also changed the jdk (switched from open jdk) at some point. I realized I needed a data container to attach to my container to share some output files, but docker does not allow you to attach data volume containers to existing containers (which would have been awesome) so i decided to commit my container as a different image.
docker commit does not spit out any error, just the id/name of the new image. I use vanilla docker run with the additional --volumes-from.
When I attach a terminal to my container afterwards, I don’t see any of the libraries jenkins had downloaded, nor do i find the new jdk or other config files i changed.