From ad6cf9a8c1336369b0fb89ea0e9412c812ee7c9f Mon Sep 17 00:00:00 2001 From: David Byron Date: Wed, 1 May 2024 19:23:42 -0700 Subject: [PATCH] fix(docker): reduce the chance for false positives in the health check In case the health check contains more detailed information where one check could report UP but the overall status is down/out of service/etc. See https://docs.spring.io/spring-boot/docs/2.6.15/reference/html/actuator.html#actuator.endpoints.health for more. --- Dockerfile.java11.slim | 2 +- Dockerfile.java11.ubuntu | 2 +- Dockerfile.slim | 2 +- Dockerfile.ubuntu | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile.java11.slim b/Dockerfile.java11.slim index 60d0e34a5f..5bd985e849 100644 --- a/Dockerfile.java11.slim +++ b/Dockerfile.java11.slim @@ -65,5 +65,5 @@ COPY clouddriver-web/build/install/clouddriver /opt/clouddriver RUN mkdir -p /opt/clouddriver/plugins && chown -R spinnaker:nogroup /opt/clouddriver/plugins USER spinnaker -HEALTHCHECK CMD curl http://localhost:7002/health | grep UP || exit 1 +HEALTHCHECK CMD curl --fail http://localhost:7002/health CMD ["/opt/clouddriver/bin/clouddriver"] diff --git a/Dockerfile.java11.ubuntu b/Dockerfile.java11.ubuntu index b1e8d70688..a78057168e 100644 --- a/Dockerfile.java11.ubuntu +++ b/Dockerfile.java11.ubuntu @@ -62,5 +62,5 @@ RUN adduser --system --uid 10111 --group spinnaker COPY clouddriver-web/build/install/clouddriver /opt/clouddriver RUN mkdir -p /opt/clouddriver/plugins && chown -R spinnaker:nogroup /opt/clouddriver/plugins USER spinnaker -HEALTHCHECK CMD curl http://localhost:7002/health | grep UP || exit 1 +HEALTHCHECK CMD curl --fail http://localhost:7002/health CMD ["/opt/clouddriver/bin/clouddriver"] diff --git a/Dockerfile.slim b/Dockerfile.slim index 8b04690f73..7e1e72d46d 100644 --- a/Dockerfile.slim +++ b/Dockerfile.slim @@ -65,5 +65,5 @@ COPY clouddriver-web/build/install/clouddriver /opt/clouddriver RUN mkdir -p /opt/clouddriver/plugins && chown -R spinnaker:nogroup /opt/clouddriver/plugins USER spinnaker -HEALTHCHECK CMD curl http://localhost:7002/health | grep UP || exit 1 +HEALTHCHECK CMD curl --fail http://localhost:7002/health CMD ["/opt/clouddriver/bin/clouddriver"] diff --git a/Dockerfile.ubuntu b/Dockerfile.ubuntu index a471976a10..15bfb56646 100644 --- a/Dockerfile.ubuntu +++ b/Dockerfile.ubuntu @@ -62,5 +62,5 @@ RUN adduser --system --uid 10111 --group spinnaker COPY clouddriver-web/build/install/clouddriver /opt/clouddriver RUN mkdir -p /opt/clouddriver/plugins && chown -R spinnaker:nogroup /opt/clouddriver/plugins USER spinnaker -HEALTHCHECK CMD curl http://localhost:7002/health | grep UP || exit 1 +HEALTHCHECK CMD curl --fail http://localhost:7002/health CMD ["/opt/clouddriver/bin/clouddriver"]