1、编辑docker file
[root@DB docker]# vim redis.yml
redis:
image: redis
container_name: my_redis
command: redis-server /usr/local/etc/redis/redis.conf
ports:
- "6379:6379"
volumes:
- /data/redis:/data
- /data/redis/redis.conf:/usr/local/etc/redis/redis.conf
docker-compose -f redis.yml up -d mysql
docker -ps