1+ # =============================================================================
2+ # jdeathe/centos-ssh-redis
3+ #
4+ # CentOS-6, Redis 3.2.
5+ # =============================================================================
6+ FROM jdeathe/centos-ssh:1.9.0
7+
8+ RUN yum -y install \
9+ --setopt=tsflags=nodocs \
10+ --disableplugin=fastestmirror \
11+ redis32u-3.2.12-1.ius.centos6 \
12+ && yum versionlock add \
13+ redis32u* \
14+ && yum clean all
15+
16+ # -----------------------------------------------------------------------------
17+ # Copy files into place
18+ # -----------------------------------------------------------------------------
19+ ADD src/usr/bin \
20+ /usr/bin/
21+ ADD src/usr/sbin \
22+ /usr/sbin/
23+ ADD src/opt/scmi \
24+ /opt/scmi/
25+ ADD src/etc/services-config/supervisor/supervisord.d \
26+ /etc/services-config/supervisor/supervisord.d/
27+ ADD src/etc/systemd/system \
28+ /etc/systemd/system/
29+
30+ RUN ln -sf \
31+ /etc/services-config/supervisor/supervisord.d/redis-server-bootstrap.conf \
32+ /etc/supervisord.d/redis-server-bootstrap.conf \
33+ && ln -sf \
34+ /etc/services-config/supervisor/supervisord.d/redis-server-wrapper.conf \
35+ /etc/supervisord.d/redis-server-wrapper.conf \
36+ && chmod 700 \
37+ /usr/{bin/healthcheck,sbin/redis-server-{bootstrap,wrapper}} \
38+ && chmod 750 \
39+ /usr/sbin/redis-server-wrapper \
40+ && chgrp redis \
41+ /usr/sbin/redis-server-wrapper \
42+ && sed -i -r \
43+ -e "s~^(bind ).+$~\1 0.0.0.0~" \
44+ -e "s~^(# *)?(maxmemory ).+$~\2 {{REDIS_MAXMEMORY}}~" \
45+ -e "s~^(# *)?(maxmemory-policy ).+$~\2 {{REDIS_MAXMEMORY_POLICY}}~" \
46+ -e "s~^(# *)?(maxmemory-samples ).+$~\2 {{REDIS_MAXMEMORY_SAMPLES}}~" \
47+ -e "s~^(tcp-backlog ).*$~\1 {{REDIS_TCP_BACKLOG}}~" \
48+ /etc/redis.conf
49+
50+ EXPOSE 6379
51+
52+ # -----------------------------------------------------------------------------
53+ # Set default environment variables
54+ # -----------------------------------------------------------------------------
55+ ENV REDIS_AUTOSTART_REDIS_BOOTSTRAP="true" \
56+ REDIS_AUTOSTART_REDIS_WRAPPER="true" \
57+ REDIS_MAXMEMORY="64mb" \
58+ REDIS_MAXMEMORY_POLICY="allkeys-lru" \
59+ REDIS_MAXMEMORY_SAMPLES="5" \
60+ REDIS_OPTIONS="" \
61+ REDIS_TCP_BACKLOG="1024"
62+
63+ # -----------------------------------------------------------------------------
64+ # Set image metadata
65+ # -----------------------------------------------------------------------------
66+ ARG RELEASE_VERSION="1.0.0"
67+ LABEL \
68+ maintainer="James Deathe <james.deathe@gmail.com>" \
69+ install="docker run \
70+ --rm \
71+ --privileged \
72+ --volume /:/media/root \
73+ jdeathe/centos-ssh-redis:${RELEASE_VERSION} \
74+ /usr/sbin/scmi install \
75+ --chroot=/media/root \
76+ --name=\$ {NAME} \
77+ --tag=${RELEASE_VERSION}" \
78+ uninstall="docker run \
79+ --rm \
80+ --privileged \
81+ --volume /:/media/root \
82+ jdeathe/centos-ssh-redis:${RELEASE_VERSION} \
83+ /usr/sbin/scmi uninstall \
84+ --chroot=/media/root \
85+ --name=\$ {NAME} \
86+ --tag=${RELEASE_VERSION}" \
87+ org.deathe.name="centos-ssh-redis" \
88+ org.deathe.version="${RELEASE_VERSION}" \
89+ org.deathe.release="jdeathe/centos-ssh-redis:${RELEASE_VERSION}" \
90+ org.deathe.license="MIT" \
91+ org.deathe.vendor="jdeathe" \
92+ org.deathe.url="https://github.com/jdeathe/centos-ssh-redis" \
93+ org.deathe.description="CentOS-6 6.10 x86_64 - Redis 3.2."
94+
95+ HEALTHCHECK \
96+ --interval=0.5s \
97+ --timeout=1s \
98+ --retries=4 \
99+ CMD ["/usr/bin/healthcheck" ]
100+
101+ CMD ["/usr/bin/supervisord" , "--configuration=/etc/supervisord.conf" ]
0 commit comments