- Add container existence check before calling ContainerStatPath
- Provide detailed error messages when container is not found
- Add helpful hints for troubleshooting container name configuration
- Log container state information for debugging
- Include container name, path, and running state in error logs
This helps users diagnose issues when nginx-ui cannot connect to the
nginx container, particularly when the container name doesn't match
or the container is not running.
Co-authored-by: Jacky <me@jackyu.cn>
The Docker client SDK v28.5.2 defaults to API version 1.51, which may not
be supported by older Docker daemon versions. Although WithAPIVersionNegotiation()
is used, the manual Ping() call in initClient() does not trigger the automatic
version negotiation flow.
This fix explicitly calls NegotiateAPIVersionPing() with the ping response
to ensure the client uses a compatible API version with the Docker daemon.
This resolves the '404 Not Found for API route and version' error when
controlling Nginx in another Docker container.
Fixes#1543
Co-authored-by: Cursor Agent <cursoragent@cursor.com>