From 600fb54f21a507b56b0e7489d51939e539a9058d Mon Sep 17 00:00:00 2001 From: Achmad Chun Chun Date: Wed, 14 Feb 2024 20:06:12 +0700 Subject: [PATCH] Don't override LD_PRELOAD value if already set --- .../rails/generators/rails/app/templates/docker-entrypoint.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/railties/lib/rails/generators/rails/app/templates/docker-entrypoint.tt b/railties/lib/rails/generators/rails/app/templates/docker-entrypoint.tt index db341ff43b0..a8293881be8 100755 --- a/railties/lib/rails/generators/rails/app/templates/docker-entrypoint.tt +++ b/railties/lib/rails/generators/rails/app/templates/docker-entrypoint.tt @@ -1,7 +1,7 @@ #!/bin/bash -e # Enable jemalloc for reduced memory usage and latency. -if [ -f /usr/lib/*/libjemalloc.so.2 ]; then +if [ -z "${LD_PRELOAD+x}" ] && [ -f /usr/lib/*/libjemalloc.so.2 ]; then export LD_PRELOAD="$(echo /usr/lib/*/libjemalloc.so.2) $LD_PRELOAD" fi