VPS教程
专注主机评测和优惠码发布
FROM daocloud.io/centos:7
LABEL maintainer="www.domain.com"
WORKDIR /usr/local
ADD redis-6.2.3.tar.gz ./
RUN yum install make gcc -y \
&& cd /usr/local/redis-6.2.3 \
&& make PREFIX=/usr/local/redis MALLOC=libc install \
&& cp /usr/local/redis-6.2.3/redis.conf /usr/local/redis/ \
&& sed -i 's#bind 127.0.0.1#bind 0.0.0.0#g' /usr/local/redis/redis.conf \
&& ln -s /usr/local/redis/bin/* /usr/bin/
EXPOSE 6379
CMD /usr/local/redis/bin/redis-server /usr/local/redis/redis.conf
本次基于CentOS7构建Redis6.2数据库dockerfile代码如下: