Skip to content

Commit 7049b5f

Browse files
author
Einar Fløystad Dørum
authored
Add KEYDB_PASSWORD env variable to Dockerfiles (#220) (#704)
1 parent 5b12251 commit 7049b5f

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

pkg/docker/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ RUN set -eux; \
9797
echo 'if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then' >> /usr/local/bin/docker-entrypoint.sh; \
9898
echo ' set -- keydb-server "$@"' >> /usr/local/bin/docker-entrypoint.sh; \
9999
echo 'fi' >> /usr/local/bin/docker-entrypoint.sh; \
100+
echo '# if KEYDB_PASSWORD is set, add it to the arguments' >> /usr/local/bin/docker-entrypoint.sh; \
101+
echo 'if [ -n "$KEYDB_PASSWORD" ]; then' >> /usr/local/bin/docker-entrypoint.sh; \
102+
echo ' set -- "$@" --requirepass "${KEYDB_PASSWORD}"' >> /usr/local/bin/docker-entrypoint.sh; \
103+
echo 'fi' >> /usr/local/bin/docker-entrypoint.sh; \
100104
echo "# allow the container to be started with `--user`" >> /usr/local/bin/docker-entrypoint.sh; \
101105
echo 'if [ "$1" = "keydb-server" -a "$(id -u)" = "0" ]; then' >> /usr/local/bin/docker-entrypoint.sh; \
102106
echo " find . \! -user keydb -exec chown keydb '{}' +" >> /usr/local/bin/docker-entrypoint.sh; \

pkg/docker/Dockerfile_Alpine

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ RUN set -eux; \
6868
echo 'if [ "${1#-}" != "$1" ] || [ "${1%.conf}" != "$1" ]; then' >> /usr/local/bin/docker-entrypoint.sh; \
6969
echo ' set -- keydb-server "$@"' >> /usr/local/bin/docker-entrypoint.sh; \
7070
echo 'fi' >> /usr/local/bin/docker-entrypoint.sh; \
71+
echo '# if KEYDB_PASSWORD is set, add it to the arguments' >> /usr/local/bin/docker-entrypoint.sh; \
72+
echo 'if [ -n "$KEYDB_PASSWORD" ]; then' >> /usr/local/bin/docker-entrypoint.sh; \
73+
echo ' set -- "$@" --requirepass "${KEYDB_PASSWORD}"' >> /usr/local/bin/docker-entrypoint.sh; \
74+
echo 'fi' >> /usr/local/bin/docker-entrypoint.sh; \
7175
echo "# allow the container to be started with `--user`" >> /usr/local/bin/docker-entrypoint.sh; \
7276
echo 'if [ "$1" = "keydb-server" -a "$(id -u)" = "0" ]; then' >> /usr/local/bin/docker-entrypoint.sh; \
7377
echo " find . \! -user keydb -exec chown keydb '{}' +" >> /usr/local/bin/docker-entrypoint.sh; \

0 commit comments

Comments
 (0)