O'Reilly logo

Docker and Kubernetes for Java Developers by Jaroslaw Krochmalski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

HEALTHCHECK

The HEALTHCHECK instruction can be used to inform Docker how to test a container to check that it is still working. This can be checking if our rest service responds to HTTP calls or just listens on a specified port.

A container can have several statuses which can be listed using the docker ps command. These can be created, restarting, running, paused, exited, or dead. But sometimes this is not enough; a container may be still alive from Docker's point of view, but the application can hang or fail in some other way. An additional checking for the application status can be useful and HEALTHCHECK comes in handy.

The HEALTHCHECK status is initially starting. Whenever a health check passes, it becomes healthy (whatever state it was ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required