Skip to content

Commit ab638d6

Browse files
committed
feat(reids): using official redis:5-alpine docker image
1 parent 5d2308c commit ab638d6

3 files changed

Lines changed: 9 additions & 35 deletions

File tree

rootfs/Dockerfile

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,8 @@
1-
FROM quay.io/deis/base:v0.3.6
1+
FROM redis:5-alpine
22

33
COPY . /
44

5-
RUN apt-get update && \
6-
apt-get install -y --no-install-recommends redis-server && \
7-
# cleanup
8-
apt-get clean -y && \
9-
# package up license files if any by appending to existing tar
10-
COPYRIGHT_TAR='/usr/share/copyrights.tar'; \
11-
gunzip -f $COPYRIGHT_TAR.gz; tar -rf $COPYRIGHT_TAR /usr/share/doc/*/copyright; gzip $COPYRIGHT_TAR && \
12-
rm -rf \
13-
/usr/share/doc \
14-
/usr/share/man \
15-
/usr/share/info \
16-
/usr/share/locale \
17-
/var/lib/apt/lists/* \
18-
/var/cache/debconf/* \
19-
/usr/lib/x86_64-linux-gnu/gconv/IBM* \
20-
/usr/lib/x86_64-linux-gnu/gconv/EBC* && \
21-
bash -c "mkdir -p /usr/share/man/man{1..8}" && \
22-
chown -R redis:redis /etc/redis /var/lib/redis /var/log/redis
23-
245
USER redis
25-
WORKDIR /var/lib/redis
266

277
CMD ["/bin/boot"]
288
EXPOSE 6379

rootfs/bin/boot

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env sh
22

33
set -eof pipefail
44

55
REDIS_CONFIG_FILE=/etc/redis/redis.conf
66

7-
# Do not daemonize
8-
sed -i "s/daemonize yes/daemonize no/" $REDIS_CONFIG_FILE
9-
10-
# Bind to 0.0.0.0
11-
sed -i "s/bind 127.0.0.1/bind 0.0.0.0/" $REDIS_CONFIG_FILE
12-
13-
# Log to stdout
14-
sed -i "s:logfile /var/log/redis/redis-server.log:logfile \"\":" $REDIS_CONFIG_FILE
15-
167
# Set password
178
REDIS_PASSWORD_FILE=/var/run/secrets/deis/redis/creds/password
189
if [ -e $REDIS_PASSWORD_FILE ]; then
19-
REDIS_PASSWORD="$(cat /var/run/secrets/deis/redis/creds/password)"
20-
if [ ! -z "$REDIS_PASSWORD" ]; then
21-
sed -i "s/# requirepass foobared/requirepass $REDIS_PASSWORD/" $REDIS_CONFIG_FILE
22-
fi
10+
REDIS_PASSWORD="$(cat /var/run/secrets/deis/redis/creds/password)"
11+
if [ ! -z "$REDIS_PASSWORD" ]; then
12+
echo "requirepass $REDIS_PASSWOR" >> REDIS_CONFIG_FILE
13+
fi
2314
fi
2415

2516
exec redis-server $REDIS_CONFIG_FILE

rootfs/etc/redis/redis.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
daemonize no
2+
bind 0.0.0.0
3+
logfile ""

0 commit comments

Comments
 (0)