I’m sure this has been asked a hundred times before but I haven’t found the answer yet.
I am using a registry on my local network not Docker hub. I have a “baseImage” image in my registry. I create a new image, “myImage” from a docker file that has “From baseImge” in the docker file.
When I run “docker build” it pulls base image onto my local machine. Fine I have no problem with that. So now when I run “docker images” I have baseImage and myImage on my machine.
Now I run myImage (docker run) which runs an application that stores configuration settings on and other files on the container’s file system (no volumes, just the Linux file system all contained with in the image).
I now have on my system a container that has new file system changes, I have myImage and baseImage. What I want to do is create a new image (newImage) to push to the registry that contains only those new changes in the container. This would give in my registry 3 small images: newIImage based on myImage which is based on baseImage.
I thought “docker commit” would do the trick creating a new image based on the changes in the container. Well, that’s not what happens, it give me an image that contains “container changes” + baseImage".
Any ideas on how I can get an image out of just the container changes and without the 2 base images?