Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.env
.env.example
.git
.gitignore
dist
Expand Down
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
REDIS_MAXMEMORY=64mb
REDIS_MAXMEMORY_POLICY=allkeys-lru
REDIS_MAXMEMORY_SAMPLES=5
REDIS_OPTIONS=
REDIS_TCP_BACKLOG=1024
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.env
dist
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@ Summary of release changes for Version 1.

CentOS-6 6.10 x86_64 - Redis 3.2.

### 1.1.0 - 2019-02-17

- Updates source image to [1.10.0](https://github.com/jdeathe/centos-ssh/releases/tag/1.10.0).
- Updates and restructures Dockerfile.
- Updates default HEALTHCHECK interval to 1 second from 0.5.
- Updates container naming conventions and readability of `Makefile`.
- Fixes issue with unexpected published port in run templates when `DOCKER_PORT_MAP_TCP_6379` or `DOCKER_PORT_MAP_UDP_6379` is set to an empty string or 0.
- Adds placeholder replacement of `RELEASE_VERSION` docker argument to systemd service unit template.
- Adds consideration for event lag into test cases for unhealthy health_status events.
- Adds port incrementation to Makefile's run template for container names with an instance suffix.
- Adds docker-compose configuration example.
- Adds improved logging output.
- Adds improved bootstrap / wrapper scripts.
- Removes use of `/etc/services-config` paths.
- Removes X-Fleet section from etcd register template unit-file.
- Removes the unused group element from the default container name.
- Removes the node element from the default container name.
- Removes unused environment variables from Makefile and scmi configuration.
- Removes container log file `/var/log/redis-server-bootstrap` and `/var/log/redis/redis.log`.

### 1.0.1 - 2018-11-19

- Updates source image to [1.9.1](https://github.com/jdeathe/centos-ssh/releases/tag/1.9.1).
Expand Down
65 changes: 31 additions & 34 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# =============================================================================
# jdeathe/centos-ssh-redis
#
# CentOS-6, Redis 3.2.
# =============================================================================
FROM jdeathe/centos-ssh:1.9.1
FROM jdeathe/centos-ssh:1.10.0

ARG RELEASE_VERSION="1.1.0"

RUN yum -y install \
--setopt=tsflags=nodocs \
Expand All @@ -13,46 +10,47 @@ RUN yum -y install \
redis32u* \
&& yum clean all

# -----------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Copy files into place
# -----------------------------------------------------------------------------
ADD src/usr/bin \
/usr/bin/
ADD src/usr/sbin \
/usr/sbin/
# ------------------------------------------------------------------------------
ADD src/etc \
/etc/
ADD src/opt/scmi \
/opt/scmi/
ADD src/etc/services-config/supervisor/supervisord.d \
/etc/services-config/supervisor/supervisord.d/
ADD src/etc/systemd/system \
/etc/systemd/system/
ADD src/usr \
/usr/

RUN ln -sf \
/etc/services-config/supervisor/supervisord.d/redis-server-bootstrap.conf \
/etc/supervisord.d/redis-server-bootstrap.conf \
&& ln -sf \
/etc/services-config/supervisor/supervisord.d/redis-server-wrapper.conf \
/etc/supervisord.d/redis-server-wrapper.conf \
&& chmod 700 \
/usr/{bin/healthcheck,sbin/redis-server-{bootstrap,wrapper}} \
&& chmod 750 \
/usr/sbin/redis-server-wrapper \
&& chgrp redis \
/usr/sbin/redis-server-wrapper \
&& sed -i -r \
# ------------------------------------------------------------------------------
# Provisioning
# - Insert placeholders into redis configuration file
# - Replace placeholders with values in systemd service unit template
# - Set permissions
# ------------------------------------------------------------------------------
RUN sed -i -r \
-e "s~^(logfile ).+$~\1\"\"~" \
-e "s~^(bind ).+$~\10.0.0.0~" \
-e "s~^(# *)?(maxmemory ).+$~\2{{REDIS_MAXMEMORY}}~" \
-e "s~^(# *)?(maxmemory-policy ).+$~\2{{REDIS_MAXMEMORY_POLICY}}~" \
-e "s~^(# *)?(maxmemory-samples ).+$~\2{{REDIS_MAXMEMORY_SAMPLES}}~" \
-e "s~^(tcp-backlog ).*$~\1{{REDIS_TCP_BACKLOG}}~" \
/etc/redis.conf
/etc/redis.conf \
&& sed -i \
-e "s~{{RELEASE_VERSION}}~${RELEASE_VERSION}~g" \
/etc/systemd/system/centos-ssh-redis@.service \
&& chmod 644 \
/etc/supervisord.d/redis-server-{bootstrap,wrapper}.conf \
&& chmod 700 \
/usr/{bin/healthcheck,sbin/redis-server-{bootstrap,wrapper}} \
&& chmod 750 \
/usr/sbin/redis-server-wrapper \
&& chgrp redis \
/usr/sbin/redis-server-wrapper

EXPOSE 6379

# -----------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Set default environment variables
# -----------------------------------------------------------------------------
# ------------------------------------------------------------------------------
ENV REDIS_AUTOSTART_REDIS_BOOTSTRAP="true" \
REDIS_AUTOSTART_REDIS_WRAPPER="true" \
REDIS_MAXMEMORY="64mb" \
Expand All @@ -66,7 +64,6 @@ ENV REDIS_AUTOSTART_REDIS_BOOTSTRAP="true" \
# -----------------------------------------------------------------------------
# Set image metadata
# -----------------------------------------------------------------------------
ARG RELEASE_VERSION="1.0.1"
LABEL \
maintainer="James Deathe <james.deathe@gmail.com>" \
install="docker run \
Expand Down Expand Up @@ -96,7 +93,7 @@ jdeathe/centos-ssh-redis:${RELEASE_VERSION} \
org.deathe.description="CentOS-6 6.10 x86_64 - Redis 3.2."

HEALTHCHECK \
--interval=0.5s \
--interval=1s \
--timeout=1s \
--retries=4 \
CMD ["/usr/bin/healthcheck"]
Expand Down
Loading