How to build a redis container
This article is about how to build a redis container. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
# # Supervisor
# # Centos Supervisor installation
# python environment is required because it is a Python program [root@localhost wang] # python-V Python 2.7.5
Yum install python-setuptools easy_install supervisor
# Verification: log in to python after successful installation
> import supervisor
Check whether the # Supervisor configuration can be loaded successfully
Echo_supervisord_conf > / etc/supervisord.conf
Supervisor comes with Web Server, so you can manage the process through the page.
[inet_http_server]; inet (TCP) server disabled by default port=127.0.0.1:9001; (ip_address:port specifier, *: port for all iface); username=user; (default is no username (open server)); password=123; (default is no password (open server))
# start supervisor:
Supervisord-c / etc/supervisord.conf
[root@localhost wang] # ps-ef | grep supervisord root 24673 1 0 07:19? 00:00:00 / usr/bin/python / usr/bin/supervisord
Supervisord is a background management server, which is used to manage background daemons according to the policy of configuration files. Supervisorctl is used for administrators to send instructions such as start / restart / stop to background management programs.
# # docker Container starts multiple services at the same time
# create Dockerfile:
# use this image to run multiple service# add service in supervisord.confFROM centos:latestMAINTAINER edwardsbean@gmail.comRUN yum install-y supervisorRUN mkdir-p / var/run/sshdRUN mkdir-p / var/log/supervisorADD supervisord.conf / etc/supervisord.conf# expose your port to hostEXPOSE 22 80
Create supervisord.conf
[supervisord] nodaemon= truth [program: sshd] command=/usr/sbin/sshd-D [program: redis] command=redis-server / etc/redis/redis.conf
# build Image
#! / bin/bashdocker build-f / home/wang/scripts/docker/Dockerfile-t myredis.
Thank you for reading! This is the end of this article on "how to build a redis container". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!