主机评测 - Dockerfile
type: channel
link: https://zjpc.cc/tag/Dockerfile/
items: Dockerfile构建Redis6.2数据库

Dockerfile构建Redis6.2数据库
type: item
date: 2021-06-10T09:55:26+08:00
description: 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代码如下：