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+ SSH_AUTOSTART_SSHD=false \
63+ SSH_AUTOSTART_SSHD_BOOTSTRAP=false
64+
65+ # -----------------------------------------------------------------------------
66+ # Set image metadata
67+ # -----------------------------------------------------------------------------
68+ ARG RELEASE_VERSION="1.0.0"
69+ LABEL \
70+ maintainer="James Deathe <james.deathe@gmail.com>" \
71+ install="docker run \
72+ --rm \
73+ --privileged \
74+ --volume /:/media/root \
75+ jdeathe/centos-ssh-redis:${RELEASE_VERSION} \
76+ /usr/sbin/scmi install \
77+ --chroot=/media/root \
78+ --name=\$ {NAME} \
79+ --tag=${RELEASE_VERSION}" \
80+ uninstall="docker run \
81+ --rm \
82+ --privileged \
83+ --volume /:/media/root \
84+ jdeathe/centos-ssh-redis:${RELEASE_VERSION} \
85+ /usr/sbin/scmi uninstall \
86+ --chroot=/media/root \
87+ --name=\$ {NAME} \
88+ --tag=${RELEASE_VERSION}" \
89+ org.deathe.name="centos-ssh-redis" \
90+ org.deathe.version="${RELEASE_VERSION}" \
91+ org.deathe.release="jdeathe/centos-ssh-redis:${RELEASE_VERSION}" \
92+ org.deathe.license="MIT" \
93+ org.deathe.vendor="jdeathe" \
94+ org.deathe.url="https://github.com/jdeathe/centos-ssh-redis" \
95+ org.deathe.description="CentOS-6 6.10 x86_64 - Redis 3.2."
96+
97+ HEALTHCHECK \
98+ --interval=0.5s \
99+ --timeout=1s \
100+ --retries=4 \
101+ CMD ["/usr/bin/healthcheck" ]
102+
103+ CMD ["/usr/bin/supervisord" , "--configuration=/etc/supervisord.conf" ]
0 commit comments