1、Centos安装Redis参考
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 <container name> hfq/centos7:IceAge
#进入sshd启动的container
#docker exec -it <container name or id> /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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
3、开启启动配置supervisord.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
————————————————