Pull

docker pull redis:latest

Run Default Container

docker run -d --name test-redis -p 6379:6379 redis:latest

Run Custom Container

# redis.conf
bind 0.0.0.0
port 6379
 
dbfilename backup.rdb
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error no
 
appendonly yes
appendfilename appendonly.aof
appendfsync everysec
docker run -d --name test-redis -p 6379:6379 -v $(pwd)/redis.conf:/etc/redis/redis.conf -v $(pwd)/redis_data:/data redis:latest redis-server /etc/redis/redis.conf
./redis-test
├── redis.conf
└── redis_data
    ├── appendonlydir
    │   ├── appendonly.aof.1.base.rdb
    │   ├── appendonly.aof.1.incr.aof
    │   └── appendonly.aof.manifest
    └── dump.rdb

Execute Container Command

docker exec -it test-redis redis-cli

Reference

DockerHub Redis

Docker로 Redis 실행하기