Docker 에서 슈퍼 바 이 저 를 사용 하여 자동 시작 관리(redis&sshd)

3416 단어 linuxdockerredis
1.Centos 설치 Redis 참조
http://blog.csdn.net/lsziri/article/details/69389187
2、Dockerfile
    # Docker for CentOS 7

    #Base image
    FROM hfq/centos7:Jurassic

    RUN \
        wget http://download.redis.io/releases/redis-3.2.8.tar.gz && tar xzf redis-3.2.8.tar.gz \
        && cd redis-3.2.8 && yum -y install tcl && make && make install \
        && mkdir -p /etc/redis/

    #  supervisor=============================  =================================
    RUN yum -y install python-setuptools
    RUN easy_install supervisor

    ADD redis.conf /etc/redis/redis.conf
    ADD supervisord.conf /etc/supervisord.conf


    EXPOSE 6379
    EXPOSE 12007
    CMD /usr/bin/supervisord -c /etc/supervisord.conf


    ###############################################    ####################################
    #  image  
    #docker build -t hfq/centos7:IceAge .

    #  container      sshd  
    #docker run -d -P --name  hfq/centos7:IceAge

    #  sshd   container
    #docker exec -it  /bin/bash

    #docker rm $(docker ps -a | grep "xxx/jedi:v5" | awk '{print $1}')

    #    
    #docker run -d -P --name hfq-jedi-smq-IceAge hfq/centos7:IceAge

3、시작 설정 슈퍼 visord.conf 오픈
[supervisord]
nodaemon=true

[program:sshd]
command=/usr/sbin/sshd -D
autostart=true
autorestart=true

[program:redis]
command=/usr/local/bin/redis-server /etc/redis/redis.conf

좋은 웹페이지 즐겨찾기