Sign inSign up

drosenbauer/docker-counter

By drosenbauer

•Updated about 3 years ago

Returns an incrementing integer (starting with 1) on a network connection, then disconnects

Image
0

10K+

drosenbauer/docker-counter repository overview

⁠docker-counter

A tiny Docker container that simply returns an incrementing count over the network via netcat (nc) and bash.

https://hub.docker.com/r/drosenbauer/docker-counter⁠

You may specify the port as an environment variable PORT. Default port if not specified is 12345 (for counting, get it?). Note that 12345 is commonly used by malware, so your system administrators may appreciate it if you choose a different one.

⁠Example

⁠Start the listener

Note the use of PORT to listen on 54321.

devin$ docker run -it -ePORT=54321 -p 54321:54321 drosenbauer/docker-counter:latest
Listening on port 54321

The container will emit no further output after this initial message.

⁠Connect to the listener

devin$ nc localhost 54321
1
devin$ nc localhost 54321
2
devin$ nc localhost 54321
3

Tag summary

Content type

Image

Digest

sha256:cb30229db…

Size

4.2 MB

Last updated

about 3 years ago

docker pull drosenbauer/docker-counter