zoukankan      html  css  js  c++  java
  • Dockerfile 创建redis容器

    Dockerfile内容

    FROM ansible/centos7-ansible:latest
    
    MAINTAINER JPinsz
    RUN yum clean all
    RUN yum makecache fast
    RUN rpm --rebuilddb;yum install make wget vim gzip passwd openssh-server gcc -y
    RUN rm -rf /etc/yum.repos.d/*;wget -P /etc/yum.repos.d/ http://mirrors.163.com/.help/CentOS7-Base-163.repo
    #配置SSHD&修改root密码为123
    
    RUN ssh-keygen -q -t rsa -b 2048 -f /etc/ssh/ssh_host_rsa_key -N ''
    RUN ssh-keygen -q -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ''
    RUN ssh-keygen -q -t ed25519 -f /etc/ssh/ssh_host_ED25519_key -N ''
    RUN echo '123' | passwd --stdin root
    
    RUN wget -P /tmp/ http://download.redis.io/releases/redis-5.0.2.tar.gz
    
    RUN cd /tmp/;tar xzf redis-5.0.2.tar.gz;cd redis-5.0.2;make;make PREFIX=/usr/local/redis install;mkdir -p /usr/local/redis/etc/;cp redis.conf /usr/local/redis/etc/
    
    RUN mkdir -p /data/redis/
    RUN sed -i 's#^dir.*#dir /data/redis#g' /usr/local/redis/etc/redis.conf
    
    VOLUME ["/data/redis"]
    
    RUN sed -i '/^bind/s/127.0.0.1/0.0.0.0/g' /usr/local/redis/etc/redis.conf
    RUN echo "export PATH=/usr/local/redis/bin:$PATH" >> /etc/profile
    RUN source /etc/profile
    
    EXPOSE  22
    EXPOSE  6379
    CMD /usr/sbin/sshd;/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
    
  • 相关阅读:
    龟兔赛跑(动态规划)
    Dividing (多重背包 搜索)
    第k大值01背包问题
    FATE(完全背包)
    01背包 和 完全背包 详解
    放苹果(动态规划)
    max Sum(简单动态规划)
    连连看 优先对列 应用2
    尺取法
    Square(强大的剪枝)
  • 原文地址:https://www.cnblogs.com/jpinsz/p/13559158.html
Copyright © 2011-2022 走看看