feat(DockerHost): Add DockerHost.ping() to check Docker daemon availability and document health-check usage
This commit is contained in:
@@ -74,6 +74,18 @@ export class DockerHost {
|
||||
await this.imageStore.stop();
|
||||
}
|
||||
|
||||
/**
|
||||
* Ping the Docker daemon to check if it's running and accessible
|
||||
* @returns Promise that resolves if Docker is available, rejects otherwise
|
||||
* @throws Error if Docker ping fails
|
||||
*/
|
||||
public async ping(): Promise<void> {
|
||||
const response = await this.request('GET', '/_ping');
|
||||
if (response.statusCode !== 200) {
|
||||
throw new Error(`Docker ping failed with status ${response.statusCode}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* authenticate against a registry
|
||||
* @param userArg
|
||||
|
||||
Reference in New Issue
Block a user