Container images with fping, which sends ICMP echo requests to many hosts in one run and reports which of them answer. fping is compiled from the signed release tarball on Ubuntu and Alpine, for linux/amd64 and linux/arm64, and the images are rebuilt when fping publishes a release and when the base image changes.
This is an unofficial build, not affiliated with or endorsed by the fping project. Report problems with the image in this repository and fping bugs at schweikert/fping.
Ping a few hosts once and print which of them answer:
docker run --rm ghcr.io/randomcontainers/fping 192.168.1.1 192.168.1.20 printer.lan192.168.1.1 is alive
printer.lan is alive
192.168.1.20 is unreachable
fping sends to the targets in turn instead of waiting for each one. A target that does not answer within 500 ms gets three more tries, each with a wait 1.5 times as long as the one before (-t, -r and -B change this). The exit status is 0 when every target answered, 1 when some did not, and 2 when a name could not be resolved.
The entrypoint runs fping under tini, so fping's options go after the image name. A few more commands:
# Every address in a subnet that answers
docker run --rm ghcr.io/randomcontainers/fping -a -g 192.168.1.0/24
# Five pings to each host, then the packet loss and the minimum, average and maximum round-trip times
docker run --rm ghcr.io/randomcontainers/fping -c 5 -q 192.168.1.1 192.168.1.20
# The same as JSON lines: one per reply, then a summary per host
docker run --rm ghcr.io/randomcontainers/fping -J -c 5 192.168.1.1 192.168.1.20 > result.json
# Targets from standard input, one per line; lines starting with # are skipped
docker run --rm -i ghcr.io/randomcontainers/fping -f - < hosts.txtIn count mode (-c) the summary goes to standard error, unless -J is set. Upstream marks the JSON format as alpha, so it may change between releases. Running the image without arguments lists the options of the fping version in it. The manual page source, doc/fping.pod, describes them in more detail; it follows fping's development branch, which can be ahead of the release in the image.
fping first tries a raw ICMP socket, which needs root or the NET_RAW capability. Without one, it uses the kernel's ICMP ping sockets, which a user may open when one of their groups is in the range net.ipv4.ping_group_range. Docker sets that range to 0 2147483647 in every container that has its own network namespace, so the image pings as UID 1000, or as any other UID, without any capability, also under --cap-drop ALL. The binary has no setuid bit and no file capabilities.
Where the range does not include your group, fping stops with can't create socket (must run as root?):
- With
--network host, the host's setting applies. systemd sets0 2147483647by default, andsysctl net.ipv4.ping_group_rangeshows the current value. - With
--network container:<name>, the setting of that container applies. - Podman sets
0 0. With rootful Podman, pass--sysctl net.ipv4.ping_group_range="0 2147483647". - Rootless Podman, rootless Docker and Docker with
userns-remapcannot set that range, because the kernel accepts only group IDs that the container's user namespace maps. Run fping as root in the container with--user 0 --cap-add NET_RAW.
Rootless Docker and rootless Podman send pings to other hosts through ping sockets on the host, so the host's net.ipv4.ping_group_range must include your group as well, as systemd's default does.
Ping sockets send only echo requests, so --icmp-timestamp needs a raw socket, which means root with NET_RAW:
docker run --rm --user 0 --cap-add NET_RAW ghcr.io/randomcontainers/fping --icmp-timestamp -c 3 192.168.1.1-k/--fwmark needs root with NET_RAW, or with NET_ADMIN on kernels older than 5.17. Docker gives root NET_RAW by default, so --user 0 is enough there.
On Docker's default bridge network, the pings leave through Docker's network address translation, so the targets see the host's address. Use --network host to ping from the host's own interfaces and addresses, for example with -S <address> to choose the source address.
fpingin/usr/local/bin, with IPv4 and IPv6 support. It links only the C library.- On Ubuntu, the
netbasepackage, for/etc/protocols, which fping reads at startup. Alpine's base image already has that file.
Not included: the man page. fping is built without --enable-safe-limits, as in Debian and Alpine, so every user can set -i below 1 ms and -p below 10 ms. The configure flags are in /usr/local/share/randomcontainers/fping/buildinfo.
fping's default image adds no other tools, so latest and slim are the same image, with the contents listed above. Use latest to run it and the slim tags as a base for your own image.
<version> is an fping release such as 5.5, or 5.5.1 for a patch release. <minor> and <major> are its shorter forms, 5.5 and 5, and follow the newest release in that series. For a release without a patch number, such as 5.5, <version> and <minor> are the same tag. Each row lists the default tag and its slim twin, which point to the same image.
| Tags | Base |
|---|---|
latest, slim |
Ubuntu |
<version>, <version>-slim |
Ubuntu |
<minor>, <minor>-slim, <major>, <major>-slim |
Ubuntu |
ubuntu, slim-ubuntu |
Ubuntu |
<version>-ubuntu, <version>-slim-ubuntu |
Ubuntu |
<minor>-ubuntu, <minor>-slim-ubuntu, <major>-ubuntu, <major>-slim-ubuntu |
Ubuntu |
<version>-ubuntu26.04, <version>-slim-ubuntu26.04 |
Ubuntu 26.04 |
alpine, slim-alpine |
Alpine |
<version>-alpine, <version>-slim-alpine |
Alpine |
<minor>-alpine, <minor>-slim-alpine, <major>-alpine, <major>-slim-alpine |
Alpine |
<version>-alpine3.24, <version>-slim-alpine3.24 |
Alpine 3.24 |
The images are currently built on Ubuntu 26.04 and Alpine 3.24. Tags without a distro version move to the next distro release when the project does; tags ending in ubuntu26.04 or alpine3.24 stay on that release and are no longer rebuilt once the project moves to the next one. Every tag of the current fping version, including the exact version, is rebuilt in place (see Updates), so pin a digest when you need the same bytes every time.
linux/amd64 and linux/arm64, for both Ubuntu and Alpine. Both are compiled natively on GitHub-hosted runners, without emulation.
The working directory is /work. The image runs as UID 1000, and any other UID works too: HOME is then /, and caches go to /cache, which anyone can write to. How to get output files owned by you depends on how you run containers:
| Runtime | Flag |
|---|---|
| Docker on Linux (rootful), GitHub Actions | --user "$(id -u):$(id -g)" |
| Rootless Podman | --userns=keep-id |
| Rootless Docker | --user 0:0 (root in the container is your user on the host) |
| Docker Desktop on macOS or Windows | none, file ownership is mapped for you |
fping reads a file only for -f and writes nothing but its output. To read the targets from a file in the current directory, mount it:
docker run --rm --user "$(id -u):$(id -g)" -v "$PWD:/work" \
ghcr.io/randomcontainers/fping -f hosts.txtUse a slim tag as the base for your own image. slim, slim-ubuntu and slim-alpine move to each new fping release and are rebuilt when the base image changes. Switch to root to install more, then back:
FROM ghcr.io/randomcontainers/fping:slim-ubuntu@sha256:...
USER root
RUN apt-get update \
&& apt-get install -y --no-install-recommends iproute2 \
&& rm -rf /var/lib/apt/lists/*
USER 1000:1000iproute2 adds ip and ss, for looking at interfaces and routes next to fping. On Alpine, start from slim-alpine and use apk add --no-cache iproute2. The entrypoint is ["tini", "--", "fping"]; set your own ENTRYPOINT if your image runs something else. To pick up new fping releases and base image fixes, let Dependabot or Renovate update the digest in your FROM line.
Everything the image adds is under /usr/local. /usr/local/share/randomcontainers/fping/ holds the version, the source URLs, the build options, the license files and runtime-deps, the list of distro packages fping needs at run time: netbase on Ubuntu, and only the C library on Alpine.
Each image has a build provenance attestation from this repository's GitHub Actions run, signed by the shared build workflow in randomcontainers/ci:
gh attestation verify oci://ghcr.io/randomcontainers/fping:latest \
--repo randomcontainers/fping --signer-repo randomcontainers/ciImages published since November 2026 also have a keyless cosign signature from the same workflow, for admission controllers that check cosign signatures. Tags last built before then have only the attestation.
cosign verify ghcr.io/randomcontainers/fping:latest \
--certificate-identity https://github.com/randomcontainers/ci/.github/workflows/build.yml@refs/tags/v1 \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-github-workflow-repository randomcontainers/fpingEach platform image also carries an SPDX SBOM that lists every distro package with its version:
docker buildx imagetools inspect ghcr.io/randomcontainers/fping:latest --format '{{ json .SBOM }}'Before compiling, the build checks the tarball against the SHA-256 recorded in package.yml and its signature against the key of fping's maintainer, David Schweikert, in keys/fping-release.gpg (fingerprint 8D1E 89B8 FBA9 20A5 A609 F261 5A11 A22B C5A1 F734). That key is a 1024-bit DSA key from 1999 and signs with SHA-1, so the SHA-256, which is checked against the digest GitHub records for the release asset, is the stronger of the two checks.
The project checks the schweikert/fping releases every 15 minutes. A release is picked up once it is 24 hours old and has the source tarball and its signature attached. The tarball is checked against the digest GitHub records for it, the new version and the tarball's SHA-256 are committed to package.yml, and the images are rebuilt. A release signed with a key that is not in keys/fping-release.gpg fails to build until the key is added. Only the newest release is built; tags of older versions stay as they were last built.
The images of the current version are also rebuilt when the Ubuntu or Alpine base image changes and at least every 7 days, so distro security fixes reach the current tags.
docker build -f Dockerfile.ubuntu --target slim \
--build-arg VERSION=<version> \
--build-arg SOURCE_SHA256=<sha256 from package.yml> \
-t fping:local .Use Dockerfile.alpine for the Alpine image. --build-arg JOBS=<n> limits the number of parallel compile jobs.
fping was developed by Stanford University and is licensed under the University's BSD-style license, the variant SPDX calls BSD-4.3TAHOE. The license permits redistribution and use in source and binary forms on two conditions. The copyright notice and the permission paragraph must go with every copy, so the image includes COPYING. Documentation and other materials related to a distribution must acknowledge that the software was developed by Stanford University, as this section does. The name of the University may not be used to endorse or promote derived products without written permission. The license is not OSI-approved.
The option parser in src/optparse.c and src/optparse.h comes from skeeto/optparse, which is dedicated to the public domain under the Unlicense. fping's copy carries no license text, so this repository has it in licenses/LICENSE.optparse.
/usr/local/share/randomcontainers/fping/licenses/ has fping's COPYING, NOTICES, which collects the license comment of each source file that has one, and LICENSE.optparse. The image's license label is BSD-4.3TAHOE AND Unlicense. The Ubuntu and Alpine packages in the image keep their own licenses. The SBOM lists them.
/usr/local/share/randomcontainers/fping/source lists the URLs of the tarball and signature each image was built from. The build applies no patches.
The files in this repository are available under the MIT license, see LICENSE, except the license texts in licenses/, which keep their own terms.
To suggest another tool, use the Request a tool form.