On a mac.
When accessing cleos in Docker, why are files and wallets deleted after the command "exit"?
This is a docker behavior, docker has non persistent files. What are the steps that you're using to reproduce this issue? Please explain in more details so we can understand what happened.
Here is an explanation of how to persist files in docker - https://docs.docker.com/storage/volumes/