From 280c8272f8a4cea0cea8f5eafceb9ed779ba0283 Mon Sep 17 00:00:00 2001 From: Xavier Duthil Date: Fri, 5 Mar 2021 15:00:22 +0100 Subject: [PATCH] Use exec in all components' entrypoints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the exec Bash command so that the final running application becomes the container’s PID 1. This allows the application to receive any Unix signals sent to the container, in accordance with https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#entrypoint Currently, SIGTERM signals sent by kubernetes are not passed to the executed binary. Signed-off-by: Xavier Duthil --- make/photon/chartserver/docker-entrypoint.sh | 4 +--- make/photon/core/entrypoint.sh | 2 +- make/photon/exporter/entrypoint.sh | 2 +- make/photon/jobservice/entrypoint.sh | 2 +- make/photon/registry/entrypoint.sh | 2 +- make/photon/trivy-adapter/entrypoint.sh | 2 +- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/make/photon/chartserver/docker-entrypoint.sh b/make/photon/chartserver/docker-entrypoint.sh index 1a5f87d4c..0849a61b7 100644 --- a/make/photon/chartserver/docker-entrypoint.sh +++ b/make/photon/chartserver/docker-entrypoint.sh @@ -5,6 +5,4 @@ set -e /home/chart/install_cert.sh #Start the server process -/home/chart/chartm - -set +e +exec /home/chart/chartm diff --git a/make/photon/core/entrypoint.sh b/make/photon/core/entrypoint.sh index 40aa646a8..2e2e4bf79 100644 --- a/make/photon/core/entrypoint.sh +++ b/make/photon/core/entrypoint.sh @@ -4,4 +4,4 @@ set -e /harbor/install_cert.sh -/harbor/harbor_core +exec /harbor/harbor_core diff --git a/make/photon/exporter/entrypoint.sh b/make/photon/exporter/entrypoint.sh index d5bd5c9ed..cffa89bdc 100644 --- a/make/photon/exporter/entrypoint.sh +++ b/make/photon/exporter/entrypoint.sh @@ -4,4 +4,4 @@ set -e /harbor/install_cert.sh -/harbor/harbor_exporter +exec /harbor/harbor_exporter diff --git a/make/photon/jobservice/entrypoint.sh b/make/photon/jobservice/entrypoint.sh index 9c442c8c6..ad7501b08 100644 --- a/make/photon/jobservice/entrypoint.sh +++ b/make/photon/jobservice/entrypoint.sh @@ -4,4 +4,4 @@ set -e /harbor/install_cert.sh -/harbor/harbor_jobservice -c /etc/jobservice/config.yml +exec /harbor/harbor_jobservice -c /etc/jobservice/config.yml diff --git a/make/photon/registry/entrypoint.sh b/make/photon/registry/entrypoint.sh index 128406370..c762e56c4 100644 --- a/make/photon/registry/entrypoint.sh +++ b/make/photon/registry/entrypoint.sh @@ -10,4 +10,4 @@ set -e /home/harbor/install_cert.sh -/usr/bin/registry_DO_NOT_USE_GC serve /etc/registry/config.yml +exec /usr/bin/registry_DO_NOT_USE_GC serve /etc/registry/config.yml diff --git a/make/photon/trivy-adapter/entrypoint.sh b/make/photon/trivy-adapter/entrypoint.sh index e938f0923..d84d913fe 100644 --- a/make/photon/trivy-adapter/entrypoint.sh +++ b/make/photon/trivy-adapter/entrypoint.sh @@ -4,4 +4,4 @@ set -e /home/scanner/install_cert.sh -/home/scanner/bin/scanner-trivy \ No newline at end of file +exec /home/scanner/bin/scanner-trivy