Closed clintwood closed 2 years ago
Stance is unchanged from https://github.com/docker-library/cassandra/pull/122#issuecomment-426774071:
I'm sorry, but honestly if we're going to do anything more with environment variables it would likely be in the opposite direction (which we won't do due to the backwards compatibility implications) -- modifying a YAML file via shell script is very fragile, and setting complex configuration in this way is not great. For custom configuration, the only/best recommendation is to provide an appropriate
cassandra.yaml
file to your running instance (via a new image withFROM
/COPY
in a shortDockerfile
, via Docker Configs, via bind mount, [kubernetes ConfigMap,] etc).
@yosifkit I totally agree, however, it appears this repo is what is used to build cassandra images for docker hub which leaves us with no way to extend it. I guess I could add a volume in my compose file to point to an external directory with a cassandra.yaml
file and use -Dcassandra.config=/path/to/cassandra.yaml
but this is all over the place.
I've copied the Dockerfile
and docker-entrypoint.sh
to my local project but that's also not ideal.
Please feel free to close this PR.
You should be able to just overwrite the docker-entrypoint.sh
script within the published images to get yourself custom behavior:
FROM cassandra:x.y
COPY docker-entrypoint.sh /usr/local/bin/
@tianon awesome yes - that will be a solution that will keep me up to date with fixes/releases as they happen - thank you
This PR adds the ability to extend the limited set of
CASSANDRA_xxx
styleenv
vars that update thecassandra.yaml
viadocker_entrypoint.sh
This is done by setting an
env
variableEXTEND_CONFIG
with a space separated list of config keys that thedocker_entrypoint.sh
will add to it's limited list of keys to replace incassandra.yaml
.One could add this to a
docker-compose.yml
e.g.:The above would recognize the last 3
env
variables and set these appropriately in thecassandra.yaml
config file.