标签:script for std serve append file class lld 部署
docker pull centos:6
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos 6 70b5d81549ec 2 months ago 195MB
mkdir -p /data/docker/lnmp-test/dockerfile/redis
vim /data/docker/lnmp-test/dockerfile/redis/Dockerfile
FROM centos:6
LABEL maintainer="1012405802@qq.com" description="Redis image"
COPY redis-3.0.2.tar.gz /root/redis-3.0.2.tar.gz
RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 && yum -y install gcc && tar -zxvf /root/redis-3.0.2.tar.gz -C /root/ && cd /root/redis-3.0.2 && make PREFIX=/usr/local/redis install && ln -s /usr/local/redis/bin/* /usr/local/bin/ && mkdir -p /etc/redis && mkdir -p /data/redis && mkdir -p /data/log && cp /root/redis-3.0.2/redis.conf /etc/redis/ && sed -i ‘s#logfile ""#logfile /data/log/redis.log#‘ /etc/redis/redis.conf && sed -i ‘s#dir ./#dir /data/redis#‘ /etc/redis/redis.conf && sed -i ‘s#appendonly no#appendonly yes#‘ /etc/redis/redis.conf && rm -rf /root/redis* && yum clean all
EXPOSE 6379
CMD ["redis-server","/etc/redis/redis.conf"]
cd /data/docker/lnmp-test/dockerfile/redis/
docker build -t centos6:redis .
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
centos6 redis f06d5e0b0a71 4 seconds ago 395MB
centos 6 70b5d81549ec 3 months ago 195MB
docker run -d -p 6379:6379 --name redis centos6:redis
firewall-cmd --add-port=6379/tcp --permanent
systemctl restart firewalld
DockerFile部署lnmp+memcached+redis+mongodb开发环境for Redis(五)
标签:script for std serve append file class lld 部署
原文地址:https://www.cnblogs.com/93bok/p/9684835.html