-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
STR
I have this docker-compose file:
# based ob https://github.com/orangecoding/fredy/blob/7ebd73c9cf209b57f667cd168f8d18c3e2e1001c/docker-compose.yml
services:
fredy:
image: ghcr.io/orangecoding/fredy
ports:
- "9998:9998"
restart: unless-stopped
healthcheck:
# The container will immediately stop when health check fails after retries
test: ["CMD-SHELL", "curl --fail --silent --show-error --max-time 5 http://localhost:9998/ || exit 1"]
interval: 120s
timeout: 10s
retries: 1
start_period: 10s
labels:
- io.containers.autoupdate=registry
Now through podman this generates:
$ cat ~/.config/containers/systemd/fredy.container
[Container]
AutoUpdate=registry
HealthCmd='curl --fail --silent --show-error --max-time 5 http://localhost:9998/ || exit 1'
HealthInterval=120s
HealthRetries=1
HealthStartPeriod=10s
HealthTimeout=10s
Image=ghcr.io/orangecoding/fredy
PublishPort=9998:9998
[Service]
Restart=always
[Install]
WantedBy=default.targetWhat happens
I noticed the container will always be unhealthy though, although manually executing the health check (like curl --fail --silent --show-error --max-time 5 http://localhost:9998/ || exit 1) works.
Docs: https://docs.docker.com/reference/compose-file/services/#healthcheck
What should happen
I found containers/podman#22804 and I guess it's the result of this aka for some reason it misses/removes the CMD-SHELL command.
Also it should remove the ' quoting, this apparently also prevents healthcheck from executing.
Aka, in this case, it should be this:
HealthCmd=CMD-SHELL curl --fail --silent --show-error --max-time 5 http://localhost:9998/ || exit 1System
$ podlet --version
podlet 0.2.4
$ podman --version
podman version 5.6.0
Metadata
Metadata
Assignees
Labels
No labels