Basic work in Redis and Docker with persistent data

docker run --name redis --rm -v /home/dmitritelinov/redis:/data -d
docker exec -it redis /bin/bash
$ redis-cli
127.0.0.1:6379>  set mykey foobar
OK
127.0.0.1:6379> get mykey
"foobar"
127.0.0.1:6379> save

$ ls /data
dump.rdb
$ exit

# on host - data is persisted, even after container is destroyed
$ ls /home/dmitritelinov/redis
dump.rdb