Skip to content

Instantly share code, notes, and snippets.

@thepatrickniyo
Created July 30, 2026 04:30
Show Gist options
  • Select an option

  • Save thepatrickniyo/d42468bb06850a8aa2ef0b3ff7f2d2e9 to your computer and use it in GitHub Desktop.

Select an option

Save thepatrickniyo/d42468bb06850a8aa2ef0b3ff7f2d2e9 to your computer and use it in GitHub Desktop.
import os
def check_container_health():
path = "/var/run/docker.sock"
if os.path.exists(path):
return "docker active"
else:
return "docker offline"
res = check_container_health()
print("Status:", res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment