Open psyciknz opened 1 year ago
So i had a dig around in the docker-entrypoint and found the command that restarts a container. And contructed the following:
curl -v -X POST --unix-socket /var/run/docker.sock http://localhost/containers/ba2ac8f3daa4/restart?t=10
When I execute that in the autoheal container, I can see the container that fails restarting.
This can be accommodated by capturing the result of the API call into stdout.
Though not using the same methodology as this project, here's an example of how this could be accommodated
I get the same problem but, launching curl command from within autoheal container, everything goes well. Logs:
24-06-2024 06:50:12 Container /apcupsd (38b41cc6f688) found to be unhealthy - Restarting container now with 10s timeout
24-06-2024 06:50:12 Restarting container 38b41cc6f688 failed
Manual restart from container:
/ # curl -v -X POST --unix-socket /var/run/docker.sock http://localhost/containers/38b41cc6f688/restart?t=10
* Trying /var/run/docker.sock:0...
* Connected to localhost (/run/docker.sock) port 80
> POST /containers/38b41cc6f688/restart?t=10 HTTP/1.1
> Host: localhost
> User-Agent: curl/8.5.0
> Accept: */*
>
< HTTP/1.1 204 No Content
< Api-Version: 1.45
< Docker-Experimental: false
< Ostype: linux
< Server: Docker/26.1.4 (linux)
< Date: Mon, 24 Jun 2024 10:11:54 GMT
<
* Connection #0 to host localhost left intact
/ #
Any way of getting more information as to why it fails?