docker-library / cassandra

Docker Official Image packaging for Cassandra
Apache License 2.0
262 stars 281 forks source link

Copy files from /etc/cassandra to $CASSANDRA_CONFIG if latter is empty and set #173

Closed n1koo closed 4 years ago

n1koo commented 5 years ago

What

Copy image provided config files from /etc/cassandra to $CASSANDRA_CONFIG if latter is custom and empty.

Why

The _inplace_sed setting variables like listen_address requires that root disk is writeable. Theres no need for it to be, runtime configs like these could very well live in eg. tmpfs mounts.

This PR allows user to set $CASSANDRA_CONFIG to eg. /etc/cassandra-rw that can live on a such tmpfs mount and then the entrypoint can set the config parameters there.

Other

We check that $CASSANDRA_CONFIG is empty so that folks having custom configs being mounted from outside aren't impacted

tianon commented 4 years ago

Sorry for the long tail :bow:

I think this is easy enough to implement in a dependent image that we'd rather not maintain this functionality here, especially given that I don't think it's a very common use case, and we already feel as though our existing entrypoint script does too much more than a stock Cassandra installation.

Thank you for the contribution! :heart: