Skip to content

Commit

Permalink
Pass additional start arguments with environment variable (#41)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
aliismayilov authored Oct 2, 2024
1 parent 7ab75b4 commit e1789aa
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion 7.2/alpine/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 7.2/debian/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 8.0/alpine/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion 8.0/debian/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ if [ "$um" = '0022' ]; then
umask 0077
fi

exec "$@"
exec "$@" $VALKEY_EXTRA_FLAGS
13 changes: 11 additions & 2 deletions dockerhub-description.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion unstable/alpine/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion unstable/debian/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e1789aa

Please sign in to comment.