Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable redis persistence in docker

According to this link, persistence of redis instances can be prevented by setting --save ''. However when I try to use that argument in my docker-compose.yml the redis instance still loads a database from disk and persists all data:

version: '3'
services:
  redis:
    image: "redis:alpine"
    command: ["redis-server", "--save"]  # disable persistence
    ports:
      - "7777:6379"

I also tried command: ["redis-server", "--save", ""] but problem preserves.

How can I enforce non-persistence (empty redis on every restart)?

like image 588
F.M.F. Avatar asked Feb 05 '19 11:02

F.M.F.


1 Answers

For me work

command: redis-server --save "" --appendonly no
image: redis:alpine
like image 53
chvmq Avatar answered Oct 15 '22 08:10

chvmq