Docker specific var settings - in docker-entrypoint.sh

operations

(Michaeljquinn) #1

Dear all
in the docker-entrypoint.sh script there are a number of env vars set, eg

: ${NEO4J_dbms_memory_heap_initial__size:=512M}
: ${NEO4J_dbms_memory_heap_max__size:=512M}

Consequently, these are ignored if set in an externally mounted /conf/neo4j.conf file and can only be
overridden as env vars ?
Is this a deliberate policy and if so, why ?
I understand why others might want to be fixed, maybe?

: ${NEO4J_dbms_connector_http_listen__address:=0.0.0.0:7474}
: ${NEO4J_dbms_connector_https_listen__address:=0.0.0.0:7473}
: ${NEO4J_dbms_connector_bolt_listen__address:=0.0.0.0:7687}

The ones of interest to me are the jvm mem settings
I could rebuild the image with an altered docker-entrypoint.sh, but before i do that, I would like to
know if I am taking the right approach

thanks all


(M. David Allen) #2

To configure these, you can either set env vars on the container, or mount a config file to /conf/neo4j.conf as you've said.

The values you're seeing there are only meant to be starter defaults so that the configuration isn't blank if you don't override it. That's the purpose, but you're not stuck with those values.

In general, a lot of people I've seen who use the docker container are overriding these with env vars that they pass in, rather than mounting a config file, but really either will work and it's up to you -- simply don't use both of those techniques at once.

If you both mounted an external file and set clashing env vars, I think that the env vars would win - but this wouldn't be a good idea.


(Michaeljquinn) #3

David
The snippet I showed

${NEO4J_dbms_connector_bolt_listen__address:=0.0.0.0:7687}

is from the docker_entrypoint.sh script, which basically says that its 7687 OR the env var, this snippet (i believe) will override whatever is set in the neo4j.conf file.

Outside of docker (which doesn't use the docker_entrypoint.sh file) of course you are correct