You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running running the image with a custom port, the docker system considers the container as unhealthy though it is not. In fact the __admin/health endpoint returns `status: "healthy".
Expected
When running the image with a custom port the docker system considers the container as healthy.
Actual Behavior
The docker system considers the container unhealthy.
Reproduction steps
Start the WireMock image - spoiler shows expected output
Check docker container - status states (unhealthy)
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a482d4afd42b wiremock/wiremock "/docker-entrypoint.…" About a minute ago Up About a minute (unhealthy) 8080/tcp, 8443/tcp, 0.0.0.0:8089->8089/tcp confident_goodall
At this point one could state this doesn't look as a big issue as the container is up and running and serving as expected. The problem manifests rather when WireMock is set up utilizing docker compose.
When looking for a workaround I found one in the docker documentation.
The section Overriding image defaults contains a paragraph related to health checks.
TL;DR
For simple docker run invocation one is able to override the health command like so:
Proposal
The Problem
When running running the image with a custom port, the docker system considers the container as unhealthy though it is not. In fact the
__admin/health
endpoint returns `status: "healthy".Expected
When running the image with a custom port the docker system considers the container as healthy.
Actual Behavior
The docker system considers the container unhealthy.
Reproduction steps
Start the WireMock image - spoiler shows expected output
Check health endpoint - also here everything looks fine
Check docker container - status states (unhealthy)
At this point one could state this doesn't look as a big issue as the container is up and running and serving as expected. The problem manifests rather when WireMock is set up utilizing docker compose.
Example
docker-compose.yaml
And the docker compose command that fails
References
A brief investigation (docker inspect) of the running container pointed to the underlying problem
Docker engine in use
$ docker version Client: Docker Engine - Community Version: 24.0.2 API version: 1.43 Go version: go1.20.4 Git commit: cb74dfc Built: Thu May 25 21:52:13 2023 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 24.0.2 API version: 1.43 (minimum version 1.12) Go version: go1.20.4 Git commit: 659604f Built: Thu May 25 21:52:13 2023 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.21 GitCommit: 3dce8eb055cbb6872793272b4f20ed16117344f8 runc: Version: 1.1.7 GitCommit: v1.1.7-0-g860f061 docker-init: Version: 0.19.0 GitCommit: de40ad0
The text was updated successfully, but these errors were encountered: