Skip to content

[Dockerfile.gemini] Healthcheck fails as 'unhealthy' due to missing 'procps' package (pgrep not found) #232

@Joseph19820124

Description

@Joseph19820124

Summary

The official Docker image for openab-gemini (ghcr.io/openabdev/openab-gemini:latest) is consistently reported as unhealthy by Docker. This is because the HEALTHCHECK command defined in Dockerfile.gemini uses pgrep, which is not available in the base node:22-bookworm-slim image without the procps package.

Reproduction Steps

  1. Pull the official image:
    docker pull ghcr.io/openabdev/openab-gemini:latest
  2. Run the container with any configuration (or even without one, as the healthcheck runs independently of the application logic):
    docker run -d --name openab-test ghcr.io/openabdev/openab-gemini:latest
  3. Wait for the healthcheck interval (30s) and observe the container status:
    docker ps
    Actual Result: The status shows (unhealthy).

Root Cause

The Dockerfile.gemini contains the following healthcheck:

HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
  CMD pgrep -x openab || exit 1

However, the node:22-bookworm-slim base image does not include the procps package (where pgrep resides). Running docker exec <id> pgrep results in an executable file not found error, causing the healthcheck to fail.

Proposed Fix

Add procps to the apt-get install command in the runtime stage of Dockerfile.gemini:

--- a/Dockerfile.gemini
+++ b/Dockerfile.gemini
@@ -10,7 +10,7 @@ RUN touch src/main.rs && cargo build --release
 
 # --- Runtime stage ---
 FROM node:22-bookworm-slim
-RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/*
+RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl procps && rm -rf /var/lib/apt/lists/*

Verification

After rebuilding the image with the above change, the container status correctly shows as (healthy) when the openab process is running.

CONTAINER ID   IMAGE                                     STATUS          NAMES
e74b564cf32f   custom-image:latest                       Up (healthy)    openab-fixed

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp2Medium — planned work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions