Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept start arguments through ENV variable #18

Closed
aliismayilov opened this issue Apr 28, 2024 · 6 comments · Fixed by #41
Closed

Accept start arguments through ENV variable #18

aliismayilov opened this issue Apr 28, 2024 · 6 comments · Fixed by #41

Comments

@aliismayilov
Copy link
Contributor

In an environment like Github Actions it is not possible to modify the start command of services. So, the only way to run valkey with different server configuration would be to maintain a derived docker image where the default CMD is overwritten or custom valkey.conf is packaged.

It would be great to be able to pass start arguments to valkey-server through an environment variable and keep using the official image.

For reference, I like how ubuntu/redis image has it through REDIS_EXTRA_FLAGS env variable. I'd be happy to submit a pull request if maintainers agree to the suggestion.

@muntdan
Copy link

muntdan commented Jun 25, 2024

Any update on this ?

@stockholmux
Copy link
Member

@roshkhatri Any thoughts on this one?

@roshkhatri
Copy link
Member

Yes, this seems to be a great idea to enable passing flags to valkey-server through VALKEY_EXTRA_FLAGS.

Sorry I could not get to this earlier.

@aliismayilov, you are more than welcome to submit a PR.

aliismayilov added a commit to aliismayilov/valkey-container that referenced this issue Sep 28, 2024
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 valkey-io#18
aliismayilov added a commit to aliismayilov/valkey-container that referenced this issue Sep 28, 2024
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 valkey-io#18

Signed-off-by: Ali Ismayilov <[email protected]>
@aliismayilov
Copy link
Contributor Author

Yes, this seems to be a great idea to enable passing flags to valkey-server through VALKEY_EXTRA_FLAGS.

Sorry I could not get to this earlier.

@aliismayilov, you are more than welcome to submit a PR.

Thanks for looking into it! You can check the PR when you have time 🙏 #41

@roshkhatri
Copy link
Member

Thank you so much!

@muntdan
Copy link

muntdan commented Oct 9, 2024

It seams that on windows CMD the ' needs to be " for the arguments:
docker run -e VALKEY_EXTRA_FLAGS='--save 60 1 --loglevel warning' valkey/valkey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants