From 09309c66026c4986ce1fb34c6d891ea155ebffd9 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 13 Feb 2020 20:07:11 -0800 Subject: [PATCH] :whale: Fix docker images with custom commands #309 --- docker/images/n8n-ubuntu/docker-entrypoint.sh | 9 +++++++-- docker/images/n8n/docker-entrypoint.sh | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/docker/images/n8n-ubuntu/docker-entrypoint.sh b/docker/images/n8n-ubuntu/docker-entrypoint.sh index d5a86c2480..80a252f31e 100755 --- a/docker/images/n8n-ubuntu/docker-entrypoint.sh +++ b/docker/images/n8n-ubuntu/docker-entrypoint.sh @@ -6,5 +6,10 @@ if [ -d /root/.n8n ] ; then ln -s /root/.n8n /home/node/ fi -if [ "$#" -gt 0 ]; then shift; fi -exec gosu node n8n $@ +if [ "$#" -gt 0 ]; then + # Got started with arguments + exec gosu node "$@" +else + # Got started without arguments + exec gosu node n8n +fi diff --git a/docker/images/n8n/docker-entrypoint.sh b/docker/images/n8n/docker-entrypoint.sh index 45978cbc3d..153d01690d 100755 --- a/docker/images/n8n/docker-entrypoint.sh +++ b/docker/images/n8n/docker-entrypoint.sh @@ -6,5 +6,10 @@ if [ -d /root/.n8n ] ; then ln -s /root/.n8n /home/node/ fi -if [ "$#" -gt 0 ]; then shift; fi -exec su-exec node n8n $@ +if [ "$#" -gt 0 ]; then + # Got started with arguments + exec su-exec node "$@" +else + # Got started without arguments + exec su-exec node n8n +fi