diff --git a/Dockerfile b/Dockerfile index 6e131c36784fd..87b5c1bf352d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,7 +50,7 @@ RUN groupadd -g 999 argocd && \ chmod g=u /home/argocd && \ chmod g=u /etc/passwd && \ apt-get update && \ - apt-get install -y git git-lfs python3-pip && \ + apt-get install -y git git-lfs python3-pip tini && \ apt-get clean && \ pip3 install awscli==1.17.7 && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/uid_entrypoint.sh b/uid_entrypoint.sh index 2ba80ea7d40ad..3982327c7b7f7 100755 --- a/uid_entrypoint.sh +++ b/uid_entrypoint.sh @@ -9,4 +9,10 @@ if ! whoami &> /dev/null; then fi fi -exec "$@" +# If we're started as PID 1, we should wrap command execution through tini to +# prevent leakage of orphaned processes ("zombies"). +if test "$$" = "1"; then + exec tini -- $@ +else + exec "$@" +fi