Redis not obeying docker volume mounts. #6793
-
In docker-compose.yml I specify mounts for the various containers (just showing relevant stanzas)
This works for outline and postgres, but redis seems to ignore it. In /var/lib/docker/volumes I have this:
docker_redis-data is empty. However in each of the long random directory names, I see a _data/dump.rdb file. These directories are created I think every time I restart the app with docker compose down/up. It seems redis is ignoring docker-compose. There are no other docker containers running on the machine. Any idea what's going on? Have I made an error somewhere, or are others experiencing this too. Using latest version 0.75. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Please refer to the documentation for the correct way to map the volume. You're mapping a directory to a file here: |
Beta Was this translation helpful? Give feedback.
-
Yes, the documentation is where I got that line from in the first place, so I considered it to be correct. |
Beta Was this translation helpful? Give feedback.
OK, so I'm now using
volumes:
- ./redis.conf:/redis.conf
- redis-data:/data
In the docker config for the redis container, and it seems to be working. The dump.rdb is being created in /var/lib/docker/volumes/redis-data folder and the volumes with long uuids are no longer being created.
Still don't quite understand the purpose of - ./redis.conf:/redis.conf
It creates a directory in the docker compose working directory, owned by root and mapped to the /redis.conf directory in the container, both of which are empty. However the original problem has now gone away so I'll leave it here.