feat(DockerHost): Add DockerHost.ping() to check Docker daemon availability and document health-check usage

This commit is contained in:
2025-11-18 17:30:04 +00:00
parent b8a26bf3bd
commit 08af9fec14
4 changed files with 65 additions and 6 deletions

View File

@@ -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