0

I'm trying to create Redis cluster and one of its container with command:

docker run -d -v cluster-config.conf:/usr/local/etc/redis/redis.conf --name redis-1 redis redis-server /usr/local/etc/redis/redis.conf

The same way I create another redis-2,...,redis-6 containers.

My cluster-config.conf contains:

port 6379
cluster-enabled yes
cluster-config-file nodes.conf
cluster-node-timeout 5000
appendonly yes

But when I exec into any of this container I found /usr/local/etc/redis/redis.conf isn't a file, it becomes a folder:

# cat redis.conf
cat: redis.conf: Is a directory

What i did wrong so redis.conf became a directory?

Vadim Yangunaev
  • 1,817
  • 1
  • 18
  • 41
  • 4
    Since `cluster-config.conf` isn't an absolute path, Docker interprets it as a volume name; it creates a new empty Docker volume and mounts the directory tree on that path. Try `-v $(pwd)/cluster-config.conf:...` instead to force it to be an absolute path. – David Maze Feb 26 '20 at 11:51
  • For my Windows workstation this one is worked `... -v $PWD/cluster-config.conf:...` Thanks, @DavidMaze. – Vadim Yangunaev Feb 26 '20 at 11:59

0 Answers0