# FROM指定基础镜像
FROM centos:7.5
MAINTAINER dockerfile # 作者名
# 配置yum源
RUN rm -rfv /etc/yum.repos.d/*
ADD local.repo /etc/yum.repos.d/
#安装Redis
RUN yum -y install redis
# 开放端口
EXPOSE 6379
#安装清理缓存文件
RUN yum clean all
#修改绑定IP地址
RUN sed -i -e 's@bind 127.0.0.1@bind 0.0.0.0@g' /etc/redis.conf
#关闭保护模式
RUN sed -i -e 's@protected-mode yes@protected-mode no@g' /etc/redis.conf
#启动
ENTRYPOINT [ "/usr/bin/redis-server","/etc/redis.conf"]
CMD []