fdgsdf 发表于 2015-8-11 08:37:42

dockerfile 部署redis

(1)创建Dockerfile文件
# vi Dockerfile
FROM centos:centos6
MAINTAINER xuemei.cui@schoolface.cn%26gt;]cxm<xuemei.cui@schoolface.cn>
RUN yum update && yum clean all
RUN yum install -y wget
RUN wget http://download.redis.io/releases/redis-3.0.2.tar.gz
RUN tar zxvf redis-3.0.2.tar.gz
RUN cd redis-3.0.2
RUN yum groupinstall -y "Development Tools"
RUN cd redis-3.0.2 && make
RUN cp redis-3.0.2/redis.conf /etc/
RUN cp redis-3.0.2/src/redis-benchmark redis-3.0.2/src/redis-cli redis-3.0.2/src/redis-server /usr/bin/
RUN sed -i 's/daemonize no/daemonize yes/g' /etc/redis.conf
EXPOSE 6379
CMD ["redis-server", "/etc/redis.conf"]
(2)根据Dockerfile文件创建镜像
docker build -t cxm:redis --rm .
(3)启动容器
docker run -d --name redis -p 6380:6379 cxm:redis redis-server

docker run -d --name redis -p 6380:6379 cxm:redis /sbin/init

页: [1]
查看完整版本: dockerfile 部署redis