I am tracking down two incidents I have seen this week, where data was lost after the container was recreated, no worries, the data was restored =)
Just for clarity, I know about what the documentation says and the options that come with compose. I searched around and some people do ask about related issues, but they are normally about the -v option or if data was inside the container RW layer vs volume.
However, I am more curious about the language from the doc:
-v, --volumes Remove named volumes **declared in the `volumes` section** of the Compose file and anonymous volumes attached to containers.
More specifically, I am searching for the expected, documented, behavior of the down instruction when volumes are declared in the Dockerfile, but not in the docker-compose file, volumes section.
Example of related question on the same subject, in a case: Docker-Compose persistent data MySQL this questions is also confusing because the OP does declare the volume within the volumes section.