{"id":37155437,"url":"https://github.com/reitzig/docker-healthchecker","last_synced_at":"2026-01-14T18:23:00.420Z","repository":{"id":149363607,"uuid":"198497991","full_name":"reitzig/docker-healthchecker","owner":"reitzig","description":"Study of a docker-compose cluster whose health is checked by a dedicated container","archived":true,"fork":false,"pushed_at":"2020-02-18T18:59:23.000Z","size":23,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-15T00:33:23.199Z","etag":null,"topics":["docker","docker-compose","docker-health-check","go"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reitzig.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-23T19:45:55.000Z","updated_at":"2024-01-04T21:06:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"65f36038-0a9c-4394-a1b7-a737a7a53a32","html_url":"https://github.com/reitzig/docker-healthchecker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/reitzig/docker-healthchecker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reitzig%2Fdocker-healthchecker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reitzig%2Fdocker-healthchecker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reitzig%2Fdocker-healthchecker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reitzig%2Fdocker-healthchecker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reitzig","download_url":"https://codeload.github.com/reitzig/docker-healthchecker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reitzig%2Fdocker-healthchecker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28430689,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","docker-health-check","go"],"created_at":"2026-01-14T18:22:59.888Z","updated_at":"2026-01-14T18:23:00.404Z","avatar_url":"https://github.com/reitzig.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Health Check for Docker Clusters\n\nStudy of a docker-compose cluster whose overall health is checked by a \ndedicated container; in essence, it runs smoke tests from _inside_ the \ncluster network.\nThe actual checks being run are defined in\n    [healthchecks.json](healthcheck/healthchecks.json).\n\n### Motivation\n\nInspired by an actual issue at work, this mini project mainly serves as \ninvestigation grounds for which language provides the nicest way to \nimplement \"scripts\" in a container context. \nCriteria are:\n\n - Easy to write correct scripts. Ideally testable.\n - Good abstractions for readable scripts.\n - Minimal tooling required and available as Docker images.\n - Low runtime requirements for the final container.\n \nYes, I want to get rid of the ubiquitous \"small\" shell script as a \ndefault approach.\n\n### Tested Features\n\nMore specifically, the following language or library features are needed.\n\n - Command-line parameters.\n - Environment variables.\n - JSON parsing \u0026 generation.\n - File I/O.\n - External command execution. \n\n## Comparison\n\nFirst, some numbers. Smaller is better.\n\n|    | LOC | LOD |  SOF  |  SLI  |\n|----|-----|-----|-------|-------|\n| Go | 135 |  15 | 5.4MB | 356MB |\n\u003c!-- TODO: update after Go is done --\u003e\n\nWhere the metrics are defined as follows:\n\n - _LOC_ -- Lines of \"script\" (and tooling) code\n - _LOD_ -- Lines in Dockerfile.\n - _SOF_ -- size overhead in the final image, \n     that is the size of the final image minus the size of `healthcheck`.\n - _SLI_ -- size of the largest intermediate image.\n\nAnd now some subjective observations.\n\n\u003c!-- ### TODO: Bash -- the reference --\u003e\n\n\u003c!-- ### TODO: Ruby -- why scripting languages don't help --\u003e\n\n### Go\n\n - The standard library (or, for that matter, the official Docker container)\n   has everything we need here.\n - No tooling beyond the compiler required.\n - Code is reasonably neat and could be tested.\n - Struct-based JSON marshalling makes for safe code.\n - Some gaps in the standard library that are off for a modern language,\n   e.g. higher-order collection functions.\n\n\u003c!-- ### TODO: Kotlin Native --\u003e\n\n\u003c!-- ### TODO: Crystal --\u003e\n\n\u003c!-- ### TODO: Swift? --\u003e\n\n\u003c!-- ### TODO: Rust? --\u003e\n\n\u003c!-- ### TODO: Nim? --\u003e\n\n## Run\n\n```bash\ndocker build -t healthcheck --build-arg checks=healthchecks.json healthcheck/\ndocker-compose -d up\n```\n\nCheck\n    [docker-compose.yml](docker-compose.yml)\nfor the port mappings of the individual healthcheckers.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freitzig%2Fdocker-healthchecker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freitzig%2Fdocker-healthchecker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freitzig%2Fdocker-healthchecker/lists"}