{"id":19987455,"url":"https://github.com/sdavids/sdavids-docker-healthcheck","last_synced_at":"2026-04-10T13:32:16.931Z","repository":{"id":255662886,"uuid":"450716522","full_name":"sdavids/sdavids-docker-healthcheck","owner":"sdavids","description":"Docker health checks","archived":false,"fork":false,"pushed_at":"2026-03-22T13:19:16.000Z","size":642,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-23T01:03:16.106Z","etag":null,"topics":["docker","golang","nodejs","rust"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sdavids.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":null,"license":"LICENSES/Apache-2.0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-01-22T04:30:47.000Z","updated_at":"2026-03-22T13:19:20.000Z","dependencies_parsed_at":"2024-10-17T21:31:27.539Z","dependency_job_id":"a1a55cea-ab56-4d17-8bcd-5fac6391a046","html_url":"https://github.com/sdavids/sdavids-docker-healthcheck","commit_stats":null,"previous_names":["sdavids/sdavids-docker-healthcheck"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sdavids/sdavids-docker-healthcheck","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdavids%2Fsdavids-docker-healthcheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdavids%2Fsdavids-docker-healthcheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdavids%2Fsdavids-docker-healthcheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdavids%2Fsdavids-docker-healthcheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sdavids","download_url":"https://codeload.github.com/sdavids/sdavids-docker-healthcheck/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdavids%2Fsdavids-docker-healthcheck/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31645284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: 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","golang","nodejs","rust"],"created_at":"2024-11-13T04:36:22.681Z","updated_at":"2026-04-10T13:32:16.912Z","avatar_url":"https://github.com/sdavids.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"// SPDX-FileCopyrightText: © 2024 Sebastian Davids \u003csdavids@gmx.de\u003e\n// SPDX-License-Identifier: Apache-2.0\n= sdavids-docker-healthcheck\nSebastian Davids \u003csdavids@gmx.de\u003e\n// Metadata:\n:description: Docker health checks\n// Settings:\n:sectnums:\n:sectanchors:\n:sectlinks:\n:toc: macro\n:toclevels: 3\n:toc-placement!:\n:hide-uri-scheme:\n:source-highlighter: rouge\n:rouge-style: github\n// Refs:\n:docker-install-url: https://docs.docker.com/install/\n:go-install-url: https://go.dev/doc/install\n:golangci-install-url: https://golangci-lint.run/usage/install/#local-installation\n:easyrsa-install-url: https://easy-rsa.readthedocs.io/en/latest/#obtaining-and-using-easy-rsa\n:fnm-install-url: https://github.com/Schniz/fnm#installation\n:hadolint-install-url: https://github.com/hadolint/hadolint?tab=readme-ov-file#install\n:nvm-install-url: https://github.com/nvm-sh/nvm#installing-and-updating\n:rust-install-url: https://www.rust-lang.org/learn/get-started\n\nifdef::env-browser[:outfilesuffix: .adoc]\n\nifdef::env-github[]\n:outfilesuffix: .adoc\n:important-caption: :heavy_exclamation_mark:\n:note-caption: :information_source:\n:warning-caption: :warning:\nendif::[]\n\ntoc::[]\n\nAvailable Docker health checks:\n\nlink:go/http/README.adoc[Go http]:: a Go-based Docker health check for an HTTP URL\nlink:go/https/README.adoc[Go https]:: a Go-based Docker health check for an HTTP(S) URL\nlink:java/http/README.adoc/[Java http]:: a Java-based Docker health check for an HTTP URL\nlink:js/nodejs/README.adoc/[JavaScript Node.js]:: a Node.js-based Docker health check for an HTTP(S) URL\nlink:rust/http/README.adoc[Rust http]:: a Rust-based Docker health check for an HTTP URL\nlink:rust/https/README.adoc[Rust https]:: a Rust-based Docker health check for an HTTP(S) URL\nlink:shell/nc/README.adoc[shell nc]:: a nc-based Docker health check for a daemon port\n\n== Size Comparison\n\n[options=\"header,autowidth\"]\n|===\n|Program |Size |Notes\n\n|\u003c\u003cshell-nc,shell nc\u003e\u003e\n\u003e|4.0K\n|only check the daemon's port\n\n|\u003c\u003cjs-nodejs,JavaScript Node.js\u003e\u003e\n\u003e|4.0K\n|the `node` binary would add 42.1M\n\n|\u003c\u003crust-http,Rust http\u003e\u003e\n\u003e|208.0K\n|\n\n|\u003c\u003crust-https,Rust https\u003e\u003e\n\u003e|548.0K\n|\n\n|\u003c\u003cjava-http,Java http\u003e\u003e\n\u003e|3.6M\n|\n\n|\u003c\u003cgo-http,Go http\u003e\u003e\n\u003e|5.9M\n|\n\n|\u003c\u003cgo-https,Go https\u003e\u003e\n\u003e|5.9M\n|\n\n|\u003c\u003cwget-alpine,wget alpine\u003e\u003e\n\u003e|9.5M\n|\n\n|\u003c\u003cwget-debian,wget debian\u003e\u003e\n\u003e|11.0M\n|\n\n|\u003c\u003ccurl-alpine,curl alpine\u003e\u003e\n\u003e|10.7M\n|\n\n|\u003c\u003ccurl-debian,curl debian\u003e\u003e\n\u003e|22.0M\n|\n|===\n\n=== Go\n\n[#go-http]\n==== http\n\n[,console]\n----\n$ cd go/http\n$ scripts/docker_build.sh -p linux/amd64 -t go-http\n$ docker run --platform=linux/amd64 --rm de.sdavids/sdavids-docker-healthcheck:go-http sh -c 'du -kh /usr/local/bin/healthcheck'\n5.9M    /usr/local/bin/healthcheck\n----\n\n===== Usage\n\nlink:go/http/README.adoc#usage[Go http]\n\n[#go-https]\n==== https\n\n[,console]\n----\n$ cd go/https\n$ scripts/docker_build.sh -p linux/amd64 -t go-https\n$ docker run --platform=linux/amd64 --rm de.sdavids/sdavids-docker-healthcheck:go-https sh -c 'du -kh /usr/local/bin/healthcheck'\n5.9M    /usr/local/bin/healthcheck\n----\n\n===== Usage\n\nlink:go/https/README.adoc#usage[Go https]\n\n=== Java\n\n[#java-http]\n==== http\n\n[NOTE]\n====\nYou need to link:java/http/README.adoc#docker-login[authenticate] with the _ghcr.io Container registry_ to build the image.\n====\n\n[,console]\n----\n$ cd java/http\n$ scripts/docker_build.sh -p linux/amd64 -t java-http\n$ docker run --platform=linux/amd64 --rm de.sdavids/sdavids-docker-healthcheck:java-http sh -c 'du -kh /usr/local/bin/healthcheck'\n3.6M    /usr/local/bin/healthcheck\n----\n\n===== Usage\n\nlink:java/http/README.adoc#usage[Java http]\n\n=== JavaScript\n\n[#js-nodejs]\n==== Node.js\n\n[NOTE]\n====\nThis health check is only useful in a Node.js Docker image, i.e., an image where the `node` binary already exists--the `node` binary would add 42.1M.\n====\n\n[,console]\n----\n$ cd js/nodejs\n$ scripts/docker_build.sh -p linux/amd64 -t js-nodejs\n$ docker run --platform=linux/amd64 --rm de.sdavids/sdavids-docker-healthcheck:js-nodejs sh -c 'du -kh /node/healthcheck.mjs'\n4.0K    /node/healthcheck.mjs\n$ docker run --platform=linux/amd64 --rm de.sdavids/sdavids-docker-healthcheck:js-nodejs sh -c 'du -kh /usr/bin/node'\n42.1M   /usr/bin/node\n----\n\n===== Usage\n\nlink:js/nodejs/README.adoc#usage[js - nodejs]\n\n=== Rust\n\n[#rust-http]\n==== http\n\n[,console]\n----\n$ cd rust/http\n$ scripts/docker_build.sh -p linux/amd64 -t rust-http\n$ docker run --platform=linux/amd64 --rm de.sdavids/sdavids-docker-healthcheck:rust-http sh -c 'du -kh /usr/local/bin/healthcheck'\n208.0K  /usr/local/bin/healthcheck\n----\n\n===== Usage\n\nlink:rust/http/README.adoc#usage[Rust http]\n\n[#rust-https]\n==== https\n\n[NOTE]\n====\n\nYou need to create a certificate authority and its root certificate:\n\n[,console]\n----\n$ cd rust/https\n$ scripts/create_ca.sh\n$ scripts/copy_ca_root_cert.sh\n----\n\nOr copy an existing root certificate:\n\n[,console]\n----\n$ cd rust/https\n$ scripts/copy_ca_root_cert.sh\n----\n====\n\n[,console]\n----\n$ cd rust/https\n$ scripts/docker_build.sh -p linux/amd64 -t rust-https\n$ docker run --platform=linux/amd64 --rm de.sdavids/sdavids-docker-healthcheck:rust-https sh -c 'du -kh /usr/local/bin/healthcheck'\n548.0K  /usr/local/bin/healthcheck\n----\n\n===== Usage\n\nlink:rust/https/README.adoc#usage[Rust https]\n\n=== shell\n\n[#shell-nc]\n==== nc\n\n[NOTE]\n====\nThis health check will only check if the daemon's port is reachable, i.e., it will not check the HTTP body or status code of the response.\n====\n\n[,console]\n----\n$ cd shell/nc\n$ scripts/docker_build.sh -p linux/amd64 -t shell-nc\n$ docker run --platform=linux/amd64 --rm de.sdavids/sdavids-docker-healthcheck:shell-nc sh -c 'du -kh /usr/local/bin/healthcheck'\n4.0K    /usr/local/bin/healthcheck\n----\n\n===== Usage\n\nlink:shell/nc/README.adoc#usage[shell nc]\n\n=== curl\n\n[#curl-alpine]\n==== alpine\n\n[,console]\n----\n$ docker run --platform=linux/amd64 --rm alpine:3.23.3 sh -c \"apk --no-cache --quiet --no-progress add curl=8.17.0-r1 \u0026\u0026 ldd /usr/bin/curl | awk '{ print $ 3}' | xargs du -ckshL /usr/bin/curl\"\n256.0K  /usr/bin/curl\n724.0K  /usr/lib/libcurl.so.4\n104.0K  /usr/lib/libz.so.1\n652.0K  /lib/ld-musl-x86_64.so.1\n236.0K  /usr/lib/libcares.so.2\n144.0K  /usr/lib/libnghttp3.so.9\n132.0K  /usr/lib/libnghttp2.so.14\n196.0K  /usr/lib/libidn2.so.0\n76.0K   /usr/lib/libpsl.so.5\n820.0K  /usr/lib/libssl.so.3\n4.8M    /usr/lib/libcrypto.so.3\n696.0K  /usr/lib/libzstd.so.1\n56.0K   /usr/lib/libbrotlidec.so.1\n1.8M    /usr/lib/libunistring.so.5\n140.0K  /usr/lib/libbrotlicommon.so.1\n10.7M   total\n----\n\n[#curl-debian]\n==== debian\n\n[,console]\n----\n$ docker run --platform=linux/amd64 --rm debian:13.3-slim sh -c \"apt-get -qq update \u0026\u0026 apt-get -qq install -y curl=8.14.1-2+deb13u2 \u003e/dev/null 2\u003e\u00261 \u0026\u0026 ldd /usr/bin/curl | awk '{ print $ 3}' | xargs du -ckshL /usr/bin/curl\"\n316K    /usr/bin/curl\n964K    /lib/x86_64-linux-gnu/libcurl.so.4\n124K    /lib/x86_64-linux-gnu/libz.so.1\n2.0M    /lib/x86_64-linux-gnu/libc.so.6\n172K    /lib/x86_64-linux-gnu/libnghttp3.so.9\n196K    /lib/x86_64-linux-gnu/libnghttp2.so.14\n200K    /lib/x86_64-linux-gnu/libidn2.so.0\n120K    /lib/x86_64-linux-gnu/librtmp.so.1\n288K    /lib/x86_64-linux-gnu/libssh2.so.1\n76K     /lib/x86_64-linux-gnu/libpsl.so.5\n1.1M    /lib/x86_64-linux-gnu/libssl.so.3\n6.3M    /lib/x86_64-linux-gnu/libcrypto.so.3\n340K    /lib/x86_64-linux-gnu/libgssapi_krb5.so.2\n392K    /lib/x86_64-linux-gnu/libldap.so.2\n64K     /lib/x86_64-linux-gnu/liblber.so.2\n808K    /lib/x86_64-linux-gnu/libzstd.so.1\n52K     /lib/x86_64-linux-gnu/libbrotlidec.so.1\n2.0M    /lib/x86_64-linux-gnu/libunistring.so.5\n2.2M    /lib/x86_64-linux-gnu/libgnutls.so.30\n300K    /lib/x86_64-linux-gnu/libhogweed.so.6\n340K    /lib/x86_64-linux-gnu/libnettle.so.8\n556K    /lib/x86_64-linux-gnu/libgmp.so.10\n864K    /lib/x86_64-linux-gnu/libkrb5.so.3\n184K    /lib/x86_64-linux-gnu/libk5crypto.so.3\n20K     /lib/x86_64-linux-gnu/libcom_err.so.2\n52K     /lib/x86_64-linux-gnu/libkrb5support.so.0\n108K    /lib/x86_64-linux-gnu/libsasl2.so.2\n140K    /lib/x86_64-linux-gnu/libbrotlicommon.so.1\n1.7M    /lib/x86_64-linux-gnu/libp11-kit.so.0\n88K     /lib/x86_64-linux-gnu/libtasn1.so.6\n24K     /lib/x86_64-linux-gnu/libkeyutils.so.1\n64K     /lib/x86_64-linux-gnu/libresolv.so.2\n48K     /lib/x86_64-linux-gnu/libffi.so.8\n22M     total\n----\n\n=== wget\n\n[#wget-alpine]\n==== alpine\n\n[,console]\n----\n$ docker run --platform=linux/amd64 --rm alpine:3.23.3 sh -c \"apk --no-cache --quiet --no-progress add wget=1.25.0-r2 \u0026\u0026 ldd /usr/bin/wget | awk '{ print $ 3}' | xargs du -ckshL /usr/bin/wget\"\n404.0K  /usr/bin/wget\n764.0K  /usr/lib/libpcre2-8.so.0\n196.0K  /usr/lib/libidn2.so.0\n820.0K  /usr/lib/libssl.so.3\n4.8M    /usr/lib/libcrypto.so.3\n104.0K  /usr/lib/libz.so.1\n652.0K  /lib/ld-musl-x86_64.so.1\n1.8M    /usr/lib/libunistring.so.5\n9.5M    total\n----\n\n[#wget-debian]\n==== debian\n\n[,console]\n----\n$ docker run --platform=linux/amd64 --rm debian:13.3-slim sh -c \"apt-get -qq update \u0026\u0026 apt-get -qq install -y wget=1.25.0-2 \u003e/dev/null 2\u003e\u00261 \u0026\u0026 ldd /usr/bin/wget | awk '{ print $ 3}' | xargs du -ckshL /usr/bin/wget\"\n472K    /usr/bin/wget\n696K    /lib/x86_64-linux-gnu/libpcre2-8.so.0\n40K     /lib/x86_64-linux-gnu/libuuid.so.1\n200K    /lib/x86_64-linux-gnu/libidn2.so.0\n340K    /lib/x86_64-linux-gnu/libnettle.so.8\n2.2M    /lib/x86_64-linux-gnu/libgnutls.so.30\n124K    /lib/x86_64-linux-gnu/libz.so.1\n76K     /lib/x86_64-linux-gnu/libpsl.so.5\n2.0M    /lib/x86_64-linux-gnu/libc.so.6\n2.0M    /lib/x86_64-linux-gnu/libunistring.so.5\n1.7M    /lib/x86_64-linux-gnu/libp11-kit.so.0\n88K     /lib/x86_64-linux-gnu/libtasn1.so.6\n300K    /lib/x86_64-linux-gnu/libhogweed.so.6\n556K    /lib/x86_64-linux-gnu/libgmp.so.10\n48K     /lib/x86_64-linux-gnu/libffi.so.8\n11M     total\n----\n\n== Development\n\n=== Format Source Code\n\n[,console]\n----\n$ scripts/format.sh\n----\n\n=== Lint Source Code\n\n[,console]\n----\n$ scripts/lint.sh\n----\n\n== Development Environment Setup\n\n[IMPORTANT]\n====\nAfter cloning this repository, you need to install the Git hooks and configure the https://git-scm.com/docs/git-config#Documentation/git-config.txt-blameignoreRevsFile[ignore-revs-file]:\n\n[,console]\n----\n$ git config set core.hooksPath .githooks\n$ git config set blame.ignoreRevsFile .git-blame-ignore-revs\n----\n====\n\n=== Installation\n\n==== Docker\n\nInstall {docker-install-url}[Docker].\n\n==== easyrsa\n\n[IMPORTANT]\n====\nEnsure that you install version `3.1.7` and not `3.2.x`!\n====\n\n===== Linux\n\nInstall {easyrsa-install-url}[easyrsa].\n\n===== Mac\n\n[WARNING]\n====\nUnfortunately, homebrew provides `easy-rsa` version `3.2.x` .\n====\n\n[,console]\n----\n$ curl -L https://github.com/OpenVPN/easy-rsa/releases/download/v3.1.7/EasyRSA-3.1.7.tgz -o ~/Downloads/easy-rsa.tgz\n$ tar -xzf ~/Downloads/easy-rsa.tgz -C ~/.local/share\n$ mv  ~/.local/share/EasyRSA-3.1.7 ~/.local/share/easyrsa\n$ ln -s ~/.local/share/easyrsa/easyrsa ~/.local/bin/easyrsa\n$ rm ~/Downloads/easy-rsa.tgz\n----\n\n==== Go\n\nInstall {go-install-url}[Go].\n\n==== golangci-lint\n\nInstall {golangci-install-url}[golangci-lint].\n\n==== hadolint\n\n===== Linux\n\nInstall {hadolint-install-url}[hadolint].\n\n===== Mac\n\n[,console]\n----\n$ brew install hadolint\n----\n\n[#jdk]\n==== JDK\n\nThere are https://whichjdk.com[several different JDKs] and multiple options for installing them.\n\nThe https://whichjdk.com/#what-is-the-best-way-to-install-a-jdk-for-local-development[recommended] way is to https://sdkman.io/install[install via SDKMAN!]:\n\n[,console]\n----\n$ sdk install java\n----\n\n===== More Information\n\nhttps://sdkman.io/jdks[SDKMAN JDKs]\n\n==== Node Version Manager\n\nInstall {fnm-install-url}[fnm] or {nvm-install-url}[NVM].\n\n===== fnm\n\n.~/.zprofile\n[,zsh]\n----\nif command -v fnm \u003e /dev/null 2\u003e\u00261; then\n  eval \"$(fnm env --use-on-cd)\"\nfi\n----\n\n===== nvm\n\n.~/.zshrc\n[,zsh]\n----\nexport NVM_DIR=\"${HOME}/.nvm\"\n\n[ -s \"${NVM_DIR}/nvm.sh\" ] \u0026\u0026 . \"${NVM_DIR}/nvm.sh\"\n[ -s \"${NVM_DIR}/bash_completion\" ] \u0026\u0026 . \"${NVM_DIR}/bash_completion\"\n\nif command -v nvm \u003e /dev/null 2\u003e\u00261; then\n  autoload -U add-zsh-hook\n  load-nvmrc() {\n    local nvmrc_path=\"$(nvm_find_nvmrc)\"\n    if [ -n \"${nvmrc_path}\" ]; then\n      local nvmrc_node_version=$(nvm version \"$(cat \"${nvmrc_path}\")\")\n      if [ \"${nvmrc_node_version}\" = \"N/A\" ]; then\n        nvm install\n      elif [ \"${nvmrc_node_version}\" != \"$(nvm version)\" ]; then\n        nvm use\n      fi\n    elif [ -n \"$(PWD=$OLDPWD nvm_find_nvmrc)\" ] \u0026\u0026 [ \"$(nvm version)\" != \"$(nvm version default)\" ]; then\n      echo \"Reverting to nvm default version\"\n      nvm use default\n    fi\n  }\n\n  add-zsh-hook chpwd load-nvmrc\n  load-nvmrc\nfi\n----\n\n==== Rust\n\nInstall {rust-install-url}[Rust].\n\n[,console]\n----\n$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --component rust-analyzer\n----\n\n==== shellcheck\n\n===== Linux\n\n[,console]\n----\n$ sudo apt-get install shellcheck\n----\n\n===== Mac\n\n[,console]\n----\n$ brew install shellcheck\n----\n\n==== shfmt\n\n===== Linux\n\n[,console]\n----\n$ sudo apt-get install shfmt\n----\n\n===== Mac\n\n[,console]\n----\n$ brew install shfmt\n----\n\n==== yamllint\n\n===== Linux\n\n[,console]\n----\n$ sudo apt-get install yamllint\n----\n\n===== Mac\n\n[,console]\n----\n$ brew install yamllint\n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdavids%2Fsdavids-docker-healthcheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdavids%2Fsdavids-docker-healthcheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdavids%2Fsdavids-docker-healthcheck/lists"}