-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
podman incompatiblity with healthcheck from docker image #3507
Comments
Just to make sure: the healthcheck script in the image is not broken. If I manually create the container from the given image and override the healthcheck command: $ podman run --name=test ... --healthcheck-command docker-healthcheck ...
$ podman healthcheck run test; echo $?
healthy
0 Inspection on the container: ...
"Healthcheck": {
"Status": "healthy",
"FailingStreak": 0,
"Log": [
{
"Start": "2019-07-08T12:02:11.086603816+03:00",
"End": "2019-07-08T12:02:11.337532264+03:00",
"ExitCode": 0,
"Output": ""
}
]
}
...
"Healthcheck": {
"Test": [
"docker-healthcheck"
],
"Interval": 30000000000,
"Timeout": 30000000000,
"Retries": 3
} |
I guess to be 100% compatible podman should also understand |
Hm. I'm not actually sure whether this is a Buildah problem (creating the image) or a c/image problem (parsing the healthcheck out of the image). Are you building these images yourself with Podman, or pulling them down from a registry? |
I guess I could have stated this clearer in my description. These are |
Alright, it's a parsing issue, then. Thanks. |
Thanks @stefanb2, any chance you could open a PR to fix? |
It’s literally a < 3 minute check to find https://github.com/containers/libpod/blob/61c000a1d3bc58bbd669626ab67a9552088f3242/libpod/healthcheck.go#L115 and see that it handles neither (c/image does not deal with the config other than |
this is podman ... ill take a look |
oh and @mheon , you poked the bear! |
Oops. My bad. |
Make the documentation agree with the code. Related containers#3507 Signed-off-by: Stefan Becker <[email protected]>
for what I see here https://docs.docker.com/engine/reference/run/#healthcheck
it's using the shell, I wonder how I can tell it not to use default shell ? please when you are done here, please ping me on podman-compose to make it speak same language |
from what I see I guess podman should parse the value of
examples
|
@muayyad-alsadi see PR #3508 for the rename of the options to be compatible with Docker CLI. Your idea goes beyond what Docker CLI implements. It does not parse the option value as JSON string, i.e. To be 100% compatible with Docker CLI, podman should not split the option value on white space as it currently does. With Docker CLI |
Totally agree that we should not split and stay drop in replacement. But how to pass ["CMD", "/bin/foo", "funny", "unescaped", "args"]? as in docker compose files? |
If that is not possible then I guess a new PR requesting support for JSON values for |
It's not unprecedented for us to support alternative formats - for Still, I think our first course of action should be to make the CLI compatible with Docker. We can look into supporting additional features from the command line from there. |
Fix Docker CLI compatibility issue: the "--healthcheck-command" option value should not be split but instead be passed as single string to "CMD-SHELL", i.e. "/bin/sh -c <opt>". On the other hand implement the same extension as is already available for "--entrypoint", i.e. allow the option value to be a JSON array of strings. This will make life easier for tools like podman-compose. Updated "--healthcheck-command" option values in tests accordingly. Continuation of containers#3455 & containers#3507 Signed-off-by: Stefan Becker <[email protected]>
An image with "HEALTHCHECK CMD ['']" is valid but as there is no command defined the healthcheck will fail. Reject such a configuration. Fixes containers#3507 Signed-off-by: Stefan Becker <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Podman interprets the
HEALTHCHECK
section in a Docker image incorrectly. Instead of running the expected command linedocker-healthcheck
the healthcheck tries to executeCMD
.Steps to reproduce the issue:
I'm using docker images that have been created using this
Dockerfile
snippetAccording to Dockerfile reference documentation the above is correct. The healthcheck works without problem when I use the image with docker.
When I use
podman image inspect
on the docker image I see:On the container created from that image
podman container inspect
shows:i.e. the
CMD
from the originalHEALTHCHECK
line was not removed.Describe the results you received:
Executing
podman healthcheck run
returns code 125 and when inspecting the log in the container I see:Describe the results you expected:
podman healthcheck run
should trigger the commanddocker-healthcheck
inside the container.Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:The text was updated successfully, but these errors were encountered: