Search code examples
dockerpodmanhealth-check

Podman missing health check


i have an image that is based on an image with health check. In my case its the oracle database image container-registry.oracle.com/database/express:21.3.0-xe.

However, when I build my image with podman, it no longer contains the health check that it should inherit from the base image.

You can see the layer when you look into the image with podman history (see below). But neither podman nor docker show a health state when you create a container from this image.

The strange thing is that it works as intended when the image is build with docker instead of podman. I would expect it to make no difference whether it is build by podman or docker.

$ podman history bebfa0c3dc0f
ID            CREATED        CREATED BY                                     SIZE        COMMENT
bebfa0c3dc0f  44 hours ago   /bin/sh -c #(nop) COPY dir:312dcb9c3445e73...  131 kB      FROM my-image
...
<missing>     9 months ago   HEALTHCHECK &{["CMD-SHELL" "\"$ORACLE_BASE...  0 B         buildkit.dockerfile.v0
...

Solution

  • When building an image that has a HEALTHCHECK using Podman 4.4.1, I receive the warning:

    WARN[0000] HEALTHCHECK is not supported for OCI image format and will be ignored. Must use `docker` format
    

    If I add --format docker it builds without a warning, and the healthcheck works as expected.