Containers don't keep what you write
The writable layer Docker adds on top of an image is throwaway. docker rm deletes it. docker run a fresh container from the same image, and that fresh container starts from the image's filesystem — your earlier writes are gone.
This is a feature
Ephemerality is what makes containers easy to scale, replace, and patch. The cost: anything that must persist needs to live outside the container's writable layer. That's what volumes are for.