Selaa lähdekoodia

chore: move docker env var from Dockerfile to entrypoints

Zaiming Shi 4 vuotta sitten
vanhempi
commit
4bc349b596
2 muutettua tiedostoa jossa 6 lisäystä ja 6 poistoa
  1. 0 6
      deploy/docker/Dockerfile
  2. 6 0
      deploy/docker/docker-entrypoint.sh

+ 0 - 6
deploy/docker/Dockerfile

@@ -78,10 +78,4 @@ EXPOSE 1883 8081 8083 8084 8883 11883 18083 4369 4370 5369 6369 6370
 
 ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]
 
-# The default rpc port discovery 'stateless' is mostly for clusters
-# having static node names. So it's troulbe-free for multiple emqx nodes
-# running on the same host.
-# When start emqx in docker, it's mostly one emqx node in one container
-ENV EMQX_RPC__PORT_DISCOVERY=manual
-
 CMD ["/opt/emqx/bin/emqx", "foreground"]

+ 6 - 0
deploy/docker/docker-entrypoint.sh

@@ -129,4 +129,10 @@ if [[ -n "$EMQX_LOADED_MODULES" ]]; then
     fill_tuples "$LOADED_MODULES" "$EMQX_LOADED_MODULES"
 fi
 
+# The default rpc port discovery 'stateless' is mostly for clusters
+# having static node names. So it's troulbe-free for multiple emqx nodes
+# running on the same host.
+# When start emqx in docker, it's mostly one emqx node in one container
+export EMQX_RPC__PORT_DISCOVERY="${EMQX_RPC__PORT_DISCOVERY:-manual}"
+
 exec "$@"