-
Create a base image and run it
docker run -it <base_image> /bin/bash -
Make necessary changes
yum install ping -
Commit it with a new name
docker commit <hash tag of running container> new_image
Now if you open new_image by running
docker run -it new_image /bin/bash
You can see ping is installed in it.
Open base_image and there is no ping installed in it.
Hope it answered your question.