Simple Docker container to test if a port works using a Golang server
10K+
12.8MB container to check a TCP port works with a Golang HTTP server
You can download one of the binaries attached with each Github release. For example:
wget -qO port-checker https://github.com/qdm12/port-checker/releases/download/v0.1.0/port-checker_0.1.0_linux_amd64
chmod +x port-checker
./port-checker --listening-address=":8000" --root-url="/"
You can build the binary for a specific platform if it's not listed using for example:
CGO_ENALBED=0 GOARCH=amd64 go build -o port-checker github.com/qdm12/port-checker
To test port 1234, use:
docker run --rm -p 1234:8000/tcp qmcgaw/port-checker
To test port 1234 internally, use:
docker run --rm -e LISTENING_ADDRESS=":1234" qmcgaw/port-checker
š There are also image tags, such as :v0.1.0, corresponding to each tagged release.
| Environment variable | Flag | Default | Possible values | Description |
|---|---|---|---|---|
LISTENING_ADDRESS | --listening-address | :8000 | Valid listening address | TCP address to listen on internally |
ROOT_URL | --root-url | / | URL path string | Used if it is running behind a proxy for example |
Content type
Image
Digest
sha256:deb27b013ā¦
Size
3 MB
Last updated
almost 2 years ago
docker pull qmcgaw/port-checker