How do you do Spring Health Check using the Dockerfile HEALTHCHECK when using distroless?

396 Views Asked by At

Since distroless does not contain a shell or package manager, if I were to use gcr.io/distroless/java17-debian11, how would I implement something like

HEALTHCHECK --interval=5s --start-period=60s \
    CMD curl -sfo /dev/null http://localhost:8080/actuator/health

Also I'm on Docker Swarm so there's no "external http probe"

On a Java app/Spring Boot I can have multiple mains and one of them can connect to Spring actuator or some custom JMX endpoint that I had provided an answer for. However, that's extra custom code.

0

There are 0 best solutions below