FROM centos:7 MAINTAINER Yang ENV REDIS_VERSION=4.0.10 RUN yum install -y wget gcc make RUN cd / && wget http://download.redis.io/releases/redis-$REDIS_VERSION.tar.gz \ && tar -zxvf redis-$REDIS_VERSION.tar.gz \ && rm -rf redis-$REDIS_VERSION.tar.gz \ && cd /redis-$REDIS_VERSION \ && make MALLOC=libc \ && make install \ && cp /redis-$REDIS_VERSION/redis.conf /usr/local/bin/ \ && cd / \ && rm -rf redis-$REDIS_VERSION RUN mkdir /redis /redis/conf /redis/logs RUN sed -i 's/logfile ""/logfile "\/redis\/logs\/redis.log"/' /usr/local/bin/redis.conf && \ sed -i 's/bind 127.0.0.1/#bind 127.0.0.1/' /usr/local/bin/redis.conf RUN echo "ZONE=Asia/Shanghai" > /etc/sysconfig/clock && \ rm -rf /etc/localtime && \ ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime COPY start.sh / RUN chmod 777 /start.sh EXPOSE 6379 ENTRYPOINT ["/start.sh"]