File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- FROM quay.io/deis/base:v0.3.6
1+ FROM redis:5-alpine
22
33COPY . /
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-
245USER redis
25- WORKDIR /var/lib/redis
266
277CMD ["/bin/boot" ]
288EXPOSE 6379
Original file line number Diff line number Diff line change 1- #! /usr/bin/env bash
1+ #! /usr/bin/env sh
22
33set -eof pipefail
44
55REDIS_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
178REDIS_PASSWORD_FILE=/var/run/secrets/deis/redis/creds/password
189if [ -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
2314fi
2415
2516exec redis-server $REDIS_CONFIG_FILE
Original file line number Diff line number Diff line change 1+ daemonize no
2+ bind 0.0.0.0
3+ logfile ""
You can’t perform that action at this time.
0 commit comments