Dockerfile Deploying Redis

Source: Internet
Author: User

(1) Create a dockerfile file

[Email protected] ~]# VI Dockerfile
From CENTOS:CENTOS6
Maintainer cxm<[email protected]>

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) create a mirror based on the Dockerfile file

Docker build-t Cxm:redis--rm.

(3) Start the container

Docker run-d--name redis-p 6380:6379 Cxm:redis redis-server

Or

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


Dockerfile Deploying Redis

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.