From 14dac9630a5f75b9270b05eba602eb857c890707 Mon Sep 17 00:00:00 2001 From: andrewheberle Date: Thu, 27 Feb 2020 13:23:43 +0800 Subject: [PATCH] Make crond run as PID 1 This minor update to the /entry.sh script runs "crond" via "exec" to ensure it ends up as PID 1 in the container. --- Dockerfile | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5112bf07..d8cf8bb8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,13 +56,7 @@ RUN for verb in help \ printf -- "%b" "#!/usr/bin/env sh\n/root/.acme.sh/acme.sh --${verb} --config-home /acme.sh \"\$@\"" >/usr/local/bin/--${verb} && chmod +x /usr/local/bin/--${verb} \ ; done -RUN printf "%b" '#!'"/usr/bin/env sh\n \ -if [ \"\$1\" = \"daemon\" ]; then \n \ - trap \"echo stop && killall crond && exit 0\" SIGTERM SIGINT \n \ - crond && while true; do sleep 1; done;\n \ -else \n \ - exec -- \"\$@\"\n \ -fi" >/entry.sh && chmod +x /entry.sh +RUN printf '#!/usr/bin/env sh\n\nif [ "$1" = "daemon" ]; then\n exec crond -f\nfi\n\nexec -- "$@"\n' >/entry.sh && chmod +x /entry.sh VOLUME /acme.sh