Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit a8c4a57

Browse files
authored
Merge pull request #50 from jdeathe/centos-7-develop
Release changes for 2.1.1
2 parents f40244f + b37ac9a commit a8c4a57

File tree

10 files changed

+91
-83
lines changed

10 files changed

+91
-83
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
.gitignore
55
dist
66
test
7+
docker-compose.yml
78
LICENSE
89
README-short.txt
910
*.md

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ Summary of release changes for Version 2.
66

77
CentOS-7 7.5.1804 x86_64 - Redis 4.0.
88

9+
### 2.1.1 - 2019-03-21
10+
11+
- **Notice: This will be the last Version 2 release. The Version 3 release will be based on EPEL `redis` packages (i.e Redis 3.2). Version 4 will be based on IUS `redis40u` packages (i.e Redis 4.0).**
12+
- Updates source image to [2.5.1](https://github.com/jdeathe/centos-ssh/releases/tag/2.5.1).
13+
- Updates Dockerfile with combined ADD to reduce layer count in final image.
14+
- Fixes binary paths in systemd unit files for compatibility with both EL and Ubuntu hosts.
15+
- Adds improvement to pull logic in systemd unit install template.
16+
- Adds `SSH_AUTOSTART_SUPERVISOR_STDOUT` with a value "false", disabling startup of `supervisor_stdout`.
17+
- Adds improved `healtchcheck` script.
18+
- Adds `docker-compose.yml` to `.dockerignore`.
19+
- Disables disk persistence by default; primary use-case being an LRU cache.
20+
921
### 2.1.0 - 2019-02-17
1022

1123
- Updates source image to [2.5.0](https://github.com/jdeathe/centos-ssh/releases/tag/2.5.0).

Dockerfile

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
FROM jdeathe/centos-ssh:2.5.0
1+
FROM jdeathe/centos-ssh:2.5.1
22

3-
ARG RELEASE_VERSION="2.1.0"
3+
ARG RELEASE_VERSION="2.1.1"
44

55
# ------------------------------------------------------------------------------
66
# Base install of required packages
@@ -16,12 +16,7 @@ RUN yum -y install \
1616
# ------------------------------------------------------------------------------
1717
# Copy files into place
1818
# ------------------------------------------------------------------------------
19-
ADD src/etc \
20-
/etc/
21-
ADD src/opt/scmi \
22-
/opt/scmi/
23-
ADD src/usr \
24-
/usr/
19+
ADD src /
2520

2621
# ------------------------------------------------------------------------------
2722
# Provisioning
@@ -32,6 +27,7 @@ ADD src/usr \
3227
RUN sed -i -r \
3328
-e "s~^(logfile ).+$~\1\"\"~" \
3429
-e "s~^(bind ).+$~\10.0.0.0~" \
30+
-e "s~^(save [0-9]+ [0-9]+)~#\1~" \
3531
-e "s~^(# *)?(maxmemory ).+$~\2{{REDIS_MAXMEMORY}}~" \
3632
-e "s~^(# *)?(maxmemory-policy ).+$~\2{{REDIS_MAXMEMORY_POLICY}}~" \
3733
-e "s~^(# *)?(maxmemory-samples ).+$~\2{{REDIS_MAXMEMORY_SAMPLES}}~" \
@@ -62,7 +58,8 @@ ENV REDIS_AUTOSTART_REDIS_BOOTSTRAP="true" \
6258
REDIS_OPTIONS="" \
6359
REDIS_TCP_BACKLOG="1024" \
6460
SSH_AUTOSTART_SSHD="false" \
65-
SSH_AUTOSTART_SSHD_BOOTSTRAP="false"
61+
SSH_AUTOSTART_SSHD_BOOTSTRAP="false" \
62+
SSH_AUTOSTART_SUPERVISOR_STDOUT="false"
6663

6764
# ------------------------------------------------------------------------------
6865
# Set image metadata
@@ -101,4 +98,4 @@ HEALTHCHECK \
10198
--retries=4 \
10299
CMD ["/usr/bin/healthcheck"]
103100

104-
CMD ["/usr/bin/supervisord", "--configuration=/etc/supervisord.conf"]
101+
CMD ["/usr/bin/supervisord", "--configuration=/etc/supervisord.conf"]

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ Docker Image including:
88

99
## Overview & links
1010

11-
The latest CentOS-6 / CentOS-7 based releases can be pulled from the `centos-6` / `centos-7` Docker tags respectively. For production use it is recommended to select a specific release tag - the convention is `centos-6-1.1.0` OR `1.1.0` for the [1.1.0](https://github.com/jdeathe/centos-ssh-redis/tree/1.1.0) release tag and `centos-7-2.1.0` OR `2.1.0` for the [2.1.0](https://github.com/jdeathe/centos-ssh-redis/tree/2.1.0) release tag.
11+
The latest CentOS-6 / CentOS-7 based releases can be pulled from the `centos-6` / `centos-7` Docker tags respectively. For production use it is recommended to select a specific release tag - the convention is `centos-6-1.1.1` OR `1.1.1` for the [1.1.1](https://github.com/jdeathe/centos-ssh-redis/tree/1.1.1) release tag and `centos-7-2.1.1` OR `2.1.1` for the [2.1.1](https://github.com/jdeathe/centos-ssh-redis/tree/2.1.1) release tag.
1212

1313
### Tags and respective `Dockerfile` links
1414

15-
- `centos-7`,`centos-7-2.1.0`,`2.1.0` [(centos-7/Dockerfile)](https://github.com/jdeathe/centos-ssh-redis/blob/centos-7/Dockerfile)
16-
- `centos-6`,`centos-6-1.1.0`,`1.1.0` [(centos-6/Dockerfile)](https://github.com/jdeathe/centos-ssh-redis/blob/centos-6/Dockerfile)
15+
- `centos-7`,`centos-7-2.1.1`,`2.1.1` [(centos-7/Dockerfile)](https://github.com/jdeathe/centos-ssh-redis/blob/centos-7/Dockerfile)
16+
- `centos-6`,`centos-6-1.1.1`,`1.1.1` [(centos-6/Dockerfile)](https://github.com/jdeathe/centos-ssh-redis/blob/centos-6/Dockerfile)
1717

1818
Included in the build are the [SCL](https://www.softwarecollections.org/), [EPEL](http://fedoraproject.org/wiki/EPEL) and [IUS](https://ius.io) repositories. Installed packages include [OpenSSH](http://www.openssh.com/portable.html) secure shell, [vim-minimal](http://www.vim.org/), are installed along with python-setuptools, [supervisor](http://supervisord.org/) and [supervisor-stdout](https://github.com/coderanger/supervisor-stdout).
1919

@@ -40,7 +40,7 @@ $ docker run -d \
4040
--name redis.1 \
4141
-p 6379:6379/tcp \
4242
--sysctl "net.core.somaxconn=1024" \
43-
jdeathe/centos-ssh-redis:2.1.0
43+
jdeathe/centos-ssh-redis:2.1.1
4444
```
4545

4646
Now you can verify it is initialised and running successfully by inspecting the container's logs.
@@ -74,7 +74,7 @@ $ docker run \
7474
--env "REDIS_MAXMEMORY_SAMPLES=10" \
7575
--env "REDIS_OPTIONS=--loglevel verbose" \
7676
--env "REDIS_TCP_BACKLOG=2048" \
77-
jdeathe/centos-ssh-redis:2.1.0
77+
jdeathe/centos-ssh-redis:2.1.1
7878
```
7979

8080
#### Environment Variables
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[program:redis-server-bootstrap]
2-
priority = 6
3-
command = /usr/sbin/redis-server-bootstrap --verbose
2+
autorestart = false
43
autostart = %(ENV_REDIS_AUTOSTART_REDIS_BOOTSTRAP)s
4+
command = /usr/sbin/redis-server-bootstrap --verbose
5+
priority = 6
6+
redirect_stderr = true
57
startsecs = 0
68
startretries = 0
7-
autorestart = false
8-
redirect_stderr = true
99
stdout_logfile = /dev/stdout
10-
stdout_logfile_maxbytes = 0
10+
stdout_logfile_maxbytes = 0
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[program:redis-server-wrapper]
2-
priority = 100
3-
command = /usr/sbin/redis-server-wrapper
4-
autostart = %(ENV_REDIS_AUTOSTART_REDIS_WRAPPER)s
5-
startsecs = 0
62
autorestart = true
3+
autostart = %(ENV_REDIS_AUTOSTART_REDIS_WRAPPER)s
4+
command = /usr/sbin/redis-server-wrapper
5+
priority = 100
76
redirect_stderr = true
7+
startsecs = 0
88
stdout_logfile = /dev/stdout
99
stdout_logfile_maxbytes = 0
10-
user = redis
10+
user = redis

src/etc/systemd/system/centos-ssh-redis.register@.service

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#
3636
# To uninstall:
3737
# sudo systemctl disable -f {service-unit-instance-name}
38+
# sudo systemctl daemon-reload
3839
# sudo rm /etc/systemd/system/{service-unit-template-name}
3940
# sudo systemctl daemon-reload
4041
# ------------------------------------------------------------------------------
@@ -91,7 +92,7 @@ ExecStart=/bin/bash -c \
9192
\"$(/usr/bin/docker port \
9293
{{SERVICE_UNIT_NAME}}.%i \
9394
6379 \
94-
| /usr/bin/sed 's~^[0-9.]*:~~' \
95+
| /bin/sed 's~^[0-9.]*:~~' \
9596
)\" \
9697
--ttl ${REGISTER_TTL} 2> /dev/null; \
9798
fi; \
@@ -104,7 +105,7 @@ ExecStart=/bin/bash -c \
104105
\"$(/usr/bin/docker port \
105106
{{SERVICE_UNIT_NAME}}.%i \
106107
6379 \
107-
| /usr/bin/sed 's~^[0-9.]*:~~' \
108+
| /bin/sed 's~^[0-9.]*:~~' \
108109
)\" \
109110
--ttl ${REGISTER_TTL} 2> /dev/null; \
110111
fi; \
@@ -129,15 +130,15 @@ ExecStart=/bin/bash -c \
129130
${REGISTER_KEY_ROOT}/ports/tcp/6379 \
130131
&> /dev/null; \
131132
then \
132-
echo set; \
133+
printf -- 'set\n'; \
133134
else \
134-
echo update; \
135+
printf -- 'update\n'; \
135136
fi) \
136137
${REGISTER_KEY_ROOT}/ports/tcp/6379 \
137138
\"$(/usr/bin/docker port \
138139
{{SERVICE_UNIT_NAME}}.%i \
139140
6379 \
140-
| /usr/bin/sed 's~^[0-9.]*:~~' \
141+
| /bin/sed 's~^[0-9.]*:~~' \
141142
)\" \
142143
--ttl ${REGISTER_TTL}; \
143144
/usr/bin/etcdctl \
@@ -148,15 +149,15 @@ ExecStart=/bin/bash -c \
148149
${REGISTER_KEY_ROOT}/ports/udp/6379 \
149150
&> /dev/null; \
150151
then \
151-
echo set; \
152+
printf -- 'set\n'; \
152153
else \
153-
echo update; \
154+
printf -- 'update\n'; \
154155
fi) \
155156
${REGISTER_KEY_ROOT}/ports/udp/6379 \
156157
\"$(/usr/bin/docker port \
157158
{{SERVICE_UNIT_NAME}}.%i \
158159
6379 \
159-
| /usr/bin/sed 's~^[0-9.]*:~~' \
160+
| /bin/sed 's~^[0-9.]*:~~' \
160161
)\" \
161162
--ttl ${REGISTER_TTL}; \
162163
fi; \
@@ -168,9 +169,9 @@ ExecStart=/bin/bash -c \
168169
${REGISTER_KEY_ROOT}/hostname \
169170
&> /dev/null; \
170171
then \
171-
echo set; \
172+
printf -- 'set\n'; \
172173
else \
173-
echo update; \
174+
printf -- 'update\n'; \
174175
fi) \
175176
${REGISTER_KEY_ROOT}/hostname \
176177
%H \

src/etc/systemd/system/centos-ssh-redis@.service

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,16 @@
2626
# sudo systemctl enable -f {service-unit-instance-name}
2727
#
2828
# Start using:
29-
# sudo systemctl [start|stop|restart|kill|status] {service-unit-instance-name}
29+
# sudo systemctl [start|stop|restart|kill|status] \
30+
# {service-unit-instance-name}
3031
#
3132
# Debugging:
3233
# sudo systemctl status {service-unit-instance-name}
3334
# journalctl -fn 50 -u {service-unit-instance-name}
3435
#
3536
# To uninstall:
3637
# sudo systemctl disable -f {service-unit-instance-name}
38+
# sudo systemctl daemon-reload
3739
# sudo systemctl stop {service-unit-instance-name}
3840
# sudo rm /etc/systemd/system/{service-unit-template-name}
3941
# sudo docker rm -f {service-unit-long-name}
@@ -68,20 +70,12 @@ Environment="SYSCTL_NET_IPV4_ROUTE_FLUSH=1"
6870

6971
# Initialisation: Load image from local storage if available, otherwise pull.
7072
ExecStartPre=/bin/bash -c \
71-
"if [[ -z $( \
72-
if [[ -n $(/usr/bin/docker images -q \
73-
${DOCKER_USER}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} \
74-
) ]]; \
75-
then \
76-
echo $(/usr/bin/docker images -q \
77-
${DOCKER_USER}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} \
78-
); \
79-
else \
80-
echo $(/usr/bin/docker images -q \
81-
docker.io/${DOCKER_USER}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} \
82-
); \
83-
fi; \
84-
) ]]; \
73+
"if [[ -z \"$(/usr/bin/docker images -q \
74+
${DOCKER_USER}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} \
75+
)\" ]] \
76+
&& [[ -z \"$(/usr/bin/docker images -q \
77+
docker.io/${DOCKER_USER}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} \
78+
)\" ]]; \
8579
then \
8680
if [[ -f ${DOCKER_IMAGE_PACKAGE_PATH}/${DOCKER_USER}/${DOCKER_IMAGE_NAME}.${DOCKER_IMAGE_TAG}.tar.xz ]]; \
8781
then \
@@ -146,7 +140,7 @@ ExecStart=/bin/bash -c \
146140
<<< \"${DOCKER_PORT_MAP_TCP_6379}\"; \
147141
&& /usr/bin/grep -qE \
148142
'^.+\.[0-9]+(\.[0-9]+)?$' \
149-
<<< "${DOCKER_NAME}"
143+
<<< %p.%i; \
150144
then \
151145
printf -- '--publish %%s%%s:6379/tcp' \
152146
$(\

src/usr/bin/healthcheck

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,38 @@
22

33
set -e
44

5-
if ! ps axo command | grep -qE '^/usr/bin/python /usr/bin/supervisord'
6-
then
7-
>&2 printf -- \
8-
'%s\n' \
9-
"supervisord not running."
10-
exit 1
11-
fi
5+
function main ()
6+
{
7+
if ! ps axo command | grep -qE '^/usr/bin/python /usr/bin/supervisord'
8+
then
9+
>&2 printf -- \
10+
'%s\n' \
11+
"supervisord not running."
12+
exit 1
13+
fi
1214

13-
# Client only mode
14-
if [[ ! ${REDIS_AUTOSTART_REDIS_BOOTSTRAP} == true ]] \
15-
|| [[ ! ${REDIS_AUTOSTART_REDIS_WRAPPER} == true ]]
16-
then
17-
exit 0
18-
fi
15+
# Client only mode
16+
if [[ ! ${REDIS_AUTOSTART_REDIS_BOOTSTRAP} == true ]] \
17+
|| [[ ! ${REDIS_AUTOSTART_REDIS_WRAPPER} == true ]]
18+
then
19+
exit 0
20+
fi
1921

20-
if ! ps axo command | grep -qE '^/usr/bin/redis-server'
21-
then
22-
>&2 printf -- \
23-
'%s\n' \
24-
"redis-server not running."
25-
exit 1
26-
fi
22+
if ! ps axo command | grep -qE '^/usr/bin/redis-server'
23+
then
24+
>&2 printf -- \
25+
'%s\n' \
26+
"redis-server not running."
27+
exit 1
28+
fi
2729

28-
if ! redis-cli PING | grep -qE '^PONG$'
29-
then
30-
>&2 printf -- \
31-
'%s\n' \
32-
"redis-server not responding."
33-
exit 1
34-
fi
30+
if ! redis-cli PING | grep -qE '^PONG$'
31+
then
32+
>&2 printf -- \
33+
'%s\n' \
34+
"redis-server not responding."
35+
exit 1
36+
fi
37+
}
3538

36-
exit 0
39+
main "${@}"

src/usr/sbin/redis-server-bootstrap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,10 @@ function main ()
259259
Redis Details
260260
--------------------------------------------------------------------------------
261261
maxmemory : ${redis_maxmemory}
262-
maxmemory-policy: ${redis_maxmemory_policy}
263-
maxmemory-samples: ${redis_maxmemory_samples}
264-
tcp-backlog: ${redis_tcp_backlog}
265-
redis-server options: ${redis_options}
262+
maxmemory-policy : ${redis_maxmemory_policy}
263+
maxmemory-samples : ${redis_maxmemory_samples}
264+
tcp-backlog : ${redis_tcp_backlog}
265+
redis-server options : ${redis_options}
266266
--------------------------------------------------------------------------------
267267
${timer_total}
268268

0 commit comments

Comments
 (0)