mendix / docker-mendix-buildpack

Build and Run Mendix in Docker
https://www.mendix.com
Apache License 2.0
81 stars 111 forks source link

Container does not always die when runtime dies #33

Closed MXClyde closed 6 years ago

MXClyde commented 6 years ago

Sometimes when the runtime dies, the container does not die with it (or only after quite a long delay). IMHO this is undesirable when used for example with Kubernetes (which normally will auto-restart failed containers). To reproduce: Start a container with an invalid license key, it will bring the container in this limbo state for a while image

ThomasJou commented 6 years ago

Hi, the way to correct this problem is to implement HEALTH_CHECK but the dockerfile has to be edited, curl has to be installed Inside the container => Is it possible to update Dockerfile adding curl package ?

carlos-salinas commented 6 years ago

Hi all,

I am glad to announce that a new version fully focused on supporting health checks is released. As it was requested, the curl command is installed in the base image allowing to define health checks using such tool.

@ThomasJou it is no necessary to edit the Dockerfile in order to have a health check. You can define it in the Docker run command. Please check the documentation here. Furthermore, we prefer to keep intact the Dockerfile to avoid collision with other health check settings, e.g. K8s liveness probe.

I want to clarify that the health check is not in charge to restart or autoheal your environment when the container becomes unhealthy. That responsibility is on the Docker runtime. Therefore, with the health check we ensure that the container status is aligned with the status of its content. For instance, if you want to deploy on K8s, the orchestrator will replace the unhealthy containers itself. Please find an example for Mendix here.