Skip to content

Embedded HEALTHCHECK doesn't work with Podman #817

Description

@openscript

Describe the bug

Running the image on Docker inside a docker-compose.yml works well. The health is reported correctly. When I use the same image on podman with podman compose no health is reported.

I'm not sure, but maybe Podman parses the HEALTHCHECK wrong?

               {
                    "created": "2025-08-11T18:59:46.801634342Z",
                    "created_by": "HEALTHCHECK &{[\"CMD\" \"/watchtower\" \"--health-check\"] \"0s\" \"0s\" \"0s\" \"0s\" '\\x00'}",
                    "comment": "buildkit.dockerfile.v0",
                    "empty_layer": true
               },

I've found this issue regarding that: podman-container-tools/podman#18904

Unfortunately I wasn't able to come up with a workaround. I've tried to formulate my own HEALTHCHECK in my compose file as such:

    healthcheck:
      test: ["/watchtower", "--health-check"]
      start_period: 10s
      interval: 10s
      timeout: 5s
      retries: 3

This will cause Podman not to start any services from my compose file. I suspect that it tries to find a shell inside the container to run the command? Any other idea how I could check the health, without wrapping the image?

Steps to reproduce

  1. Set up a podman with podman compose environment
  2. Create a docker-compose.yml:
    name: "example"
    
    services:
      watchtower:
        image: docker.io/nickfedor/watchtower:1.11.7
        restart: unless-stopped
        volumes:
          - "$XDG_RUNTIME_DIR/podman/podman.sock:/var/run/docker.sock:ro"
        command:
          - "--debug"
  3. Run podman compose up
  4. Check for health report with podman ps

Expected behavior

Health is reported correctly.

Screenshots

No response

Environment

  • Platform & Architecture: Linux 4.18.0-553.77.1.el8_10.x86_64 #1 SMP Fri Sep 19 03:36:32 EDT 2025 x86_64 x86_64 x86_64 GNU/Linux
  • Docker Version: podman version 4.9.4-rhel

Your logs

Not applicable

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    PodmanPodman-related itemsenhancementNew feature or request

    Projects

    Status
    Feature Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions