redis:
image: redis:${REDIS_VERSION}
container_name: redis
ports:
- "6379:6379"
volumes:
- ./file/redis.conf:/etc/redis.conf
- ./data/redis/:/data
- ./logs/redis.log:/usr/local/redis/redis.log
restart: always
entrypoint: ["redis-server", "/etc/redis.conf"]
启动后 日志 报错:
Can't chdir to '/usr/local/redis/data': No such file or directory
看了很多 dockercompose 文件,都让挂在 /data 和 /usr/local/redis/data 其实是一样的,咋整?
1
neoblackcap 2020-01-25 01:38:48 +08:00
能挂载的只有目录,文件是不能挂载的,挂载父目录吧
|
2
shellcmd 2020-01-25 11:42:20 +08:00 via Android
手动新建一下呢?
|
3
Mitt 2020-01-25 12:03:35 +08:00 via iPhone
entrypoint 那行注释掉
|
4
codehz 2020-01-25 20:10:01 +08:00
|
5
neoblackcap 2020-01-25 21:13:16 +08:00
@codehz 你说的对,经过试验是我错了,应该用绝对路径就好了
|