Images of containers are immutable. (i.e. when you start a container, and make file modifications, it does not modify the original image.) However, you can create a new image based off of the modified container.
Start an Ubuntu Container:
docker run -it ubuntu /bin/bash
Make a change to the container and exit
touch /tmp/foo
ls /tmp/foo
Notice the file
exit
Start the container again
docker run -it ubuntu /bin/bash
ls /tmp/foo
Start an Ubuntu Container:
docker run -it ubuntu /bin/bash
Make a change to the container and exit
touch /tmp/foo
ls /tmp/foo
IN A NEW WINDOW, with the container still running:
docker ps -a | head -2
docker diff <Container ID>
Commit the container
docker commit <Container ID> ubuntu-foo
docker run -it ubuntu-foo /bin/bash
ls /tmp/foo
Now the file exists