docker下载redis镜像
docker pull redis:bullseye
查看redis镜像
docker images
创建redis容器
docker run \
-d \
--name redis \
-p 6379:6379 \
--restart unless-stopped \
-v /mydata/redis/data:/data \
-v /mydata/redis/conf/redis.conf:/etc/redis/redis.conf \
redis:bullseye redis-server /etc/redis/redis.conf
查看redis容器
docker ps
设置开机自启
docker update --restart=always {容器id}