The article looked a lot, but all directly from a variety of places directly pull Master,slave mirror, did not explain how these images are built
Well, I'll talk about how these master,slave mirrors are made.
Find a standard Redis image first, such as Docker pull index.tenxcloud.com/docker_library/redis:3.0 (mirror I haven't verified, I'm trying to get the company's standard image)
Then copy the redis.conf from the mirror.
Build a directory master on the machine:
It contains dockerfile,redis-master.conf,run.sh.
Redis-master.conf and copies of the redis.conf consistent, in addition to a modified
protected-mode No
Dockerfile for
From Index.tenxcloud.com/docker_library/redis:3.0COPY redis-master.conf/usr/local/etc/redis/ /"/run.sh" ]
The run.sh script is
redis-server/usr/local/etc/redis/redis.conf--protected-mode No
Build it from below Master
Docker build-t Ericnie/redis-master:3.0 .
Also create a redis-slave directory, similar to master, there are several different, redis-slave.conf configuration, open slaveof
Run.sh for
" s/%master-ip%/${redis_master_ip}/ "/usr/local/etc/redis/"s/%master-port%/{redis_master_port}/ "/usr/ local/etc/redis/Redis.confredis-server/redis-slave/redis.conf--protected-mode No
${REDIS_MASTER_IP} and ${redis_master_port} are brought in with the ENV variable to create the images.
Build slave with the following command
Docker build-t Ericnie/redis-slave:3.0 .
Redis Master-slave configuration architecture under Kubernetes