reload method
Refreshes the cached container status from the Docker daemon.
No-ops when the container has not been started yet.
Implementation
@override
Future<void> reload() async {
if (_containerId == null) {
return;
}
try {
final details = await _dockerClient.containerDetails(_requireContainerId);
final state = details['State'] as Map<String, dynamic>?;
_cachedStatus = state?['Status'] as String? ?? 'unknown';
_cachedContainerInfo = null;
} catch (e, st) {
stderr.writeln(
'testcontainers: error refreshing container status: $e\n$st',
);
_cachedStatus = 'unknown';
}
}