Would have been nice if you would have shared your exact commands.
A container keeps state until it gets deleted. If you use
docker run to create your container and just use
docker stop and
Though, if you use docker-compose and do changes on your image, be sure that the container will be delted and replaced with a new instance.
If you use Docker Swarm, the container will be replaced on every start.
This is why they say a container is ephemaral/dispossable and as such should not keeps state. If you want files to be included permantently, there is no way arround writing a Dockerfile and building your own image.