From 49e7a04a514cb4f7c00ee1f764298f7d4a6bf656 Mon Sep 17 00:00:00 2001 From: Ali Ismayilov <993934+aliismayilov@users.noreply.github.com> Date: Sat, 28 Sep 2024 00:37:29 -0400 Subject: [PATCH] Pass additional start arguments with environment variable In case you'd like to configure the start arguments of `valkey-server` with environment variable, you can pass them with `VALKEY_EXTRA_FLAGS` without having to overwrite the CMD: ```console $ docker run --env VALKEY_EXTRA_FLAGS='--save 60 1 --loglevel warning' valkey/valkey ``` resolves #18 Signed-off-by: Ali Ismayilov <993934+aliismayilov@users.noreply.github.com> --- 7.2/alpine/docker-entrypoint.sh | 2 +- 7.2/debian/docker-entrypoint.sh | 2 +- 8.0/alpine/docker-entrypoint.sh | 2 +- 8.0/debian/docker-entrypoint.sh | 2 +- docker-entrypoint.sh | 2 +- dockerhub-description.md | 13 +++++++++++-- unstable/alpine/docker-entrypoint.sh | 2 +- unstable/debian/docker-entrypoint.sh | 2 +- 8 files changed, 18 insertions(+), 9 deletions(-) diff --git a/7.2/alpine/docker-entrypoint.sh b/7.2/alpine/docker-entrypoint.sh index 5abf089..b763f03 100755 --- a/7.2/alpine/docker-entrypoint.sh +++ b/7.2/alpine/docker-entrypoint.sh @@ -19,4 +19,4 @@ if [ "$um" = '0022' ]; then umask 0077 fi -exec "$@" +exec "$@" $VALKEY_EXTRA_FLAGS diff --git a/7.2/debian/docker-entrypoint.sh b/7.2/debian/docker-entrypoint.sh index 5abf089..b763f03 100755 --- a/7.2/debian/docker-entrypoint.sh +++ b/7.2/debian/docker-entrypoint.sh @@ -19,4 +19,4 @@ if [ "$um" = '0022' ]; then umask 0077 fi -exec "$@" +exec "$@" $VALKEY_EXTRA_FLAGS diff --git a/8.0/alpine/docker-entrypoint.sh b/8.0/alpine/docker-entrypoint.sh index 5abf089..b763f03 100755 --- a/8.0/alpine/docker-entrypoint.sh +++ b/8.0/alpine/docker-entrypoint.sh @@ -19,4 +19,4 @@ if [ "$um" = '0022' ]; then umask 0077 fi -exec "$@" +exec "$@" $VALKEY_EXTRA_FLAGS diff --git a/8.0/debian/docker-entrypoint.sh b/8.0/debian/docker-entrypoint.sh index 5abf089..b763f03 100755 --- a/8.0/debian/docker-entrypoint.sh +++ b/8.0/debian/docker-entrypoint.sh @@ -19,4 +19,4 @@ if [ "$um" = '0022' ]; then umask 0077 fi -exec "$@" +exec "$@" $VALKEY_EXTRA_FLAGS diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 5abf089..b763f03 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -19,4 +19,4 @@ if [ "$um" = '0022' ]; then umask 0077 fi -exec "$@" +exec "$@" $VALKEY_EXTRA_FLAGS diff --git a/dockerhub-description.md b/dockerhub-description.md index 2deadbb..66844ab 100644 --- a/dockerhub-description.md +++ b/dockerhub-description.md @@ -1,9 +1,9 @@ # Quick reference -- **Maintained by**: +- **Maintained by**: [the Valkey Community](https://github.com/valkey-io/valkey-container) -- **Where to get help**: +- **Where to get help**: Please open an Issue stating your question on [the Valkey Community](https://github.com/valkey-io/valkey-container/issues). # Supported tags and respective `Dockerfile` links @@ -49,6 +49,15 @@ There are several different persistence strategies to choose from. This one will $ docker run -it --network some-network --rm valkey/valkey valkey-cli -h some-valkey ``` +## Pass additional start arguments with environment variable + +In case you'd like to configure the start arguments of `valkey-server` +with environment variable, you can pass them with `VALKEY_EXTRA_FLAGS` +without having to overwrite the CMD: +```console +$ docker run --env VALKEY_EXTRA_FLAGS='--save 60 1 --loglevel warning' valkey/valkey +``` + ## Additionally, If you want to use your own valkey.conf ... You can create your own Dockerfile that adds a valkey.conf from the context into /data/, like so. diff --git a/unstable/alpine/docker-entrypoint.sh b/unstable/alpine/docker-entrypoint.sh index 5abf089..b763f03 100755 --- a/unstable/alpine/docker-entrypoint.sh +++ b/unstable/alpine/docker-entrypoint.sh @@ -19,4 +19,4 @@ if [ "$um" = '0022' ]; then umask 0077 fi -exec "$@" +exec "$@" $VALKEY_EXTRA_FLAGS diff --git a/unstable/debian/docker-entrypoint.sh b/unstable/debian/docker-entrypoint.sh index 5abf089..b763f03 100755 --- a/unstable/debian/docker-entrypoint.sh +++ b/unstable/debian/docker-entrypoint.sh @@ -19,4 +19,4 @@ if [ "$um" = '0022' ]; then umask 0077 fi -exec "$@" +exec "$@" $VALKEY_EXTRA_FLAGS