Compare commits
6 Commits
a9818f1c8a
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| e4fdd4c16b | |||
| 4401e1b2b6 | |||
| 1724b25dcc | |||
| f0f701e2ea | |||
| c5ab25c706 | |||
| 68cb4e425f |
+4
-4
@@ -1,12 +1,12 @@
|
|||||||
# simple netcat (BSD) persistent echo server running on port 5555
|
# simple netcat (BSD) persistent "listen" server running on port 5555
|
||||||
# running on Alpine Linux
|
# running on Alpine Linux
|
||||||
|
|
||||||
FROM alpine:3.11
|
FROM alpine:3.12
|
||||||
|
|
||||||
# standardized labels
|
# standardized labels
|
||||||
LABEL maintainer="Asif Bacchus <asif@bacchus.cloud>"
|
LABEL maintainer="Asif Bacchus <asif@bacchus.cloud>"
|
||||||
LABEL org.label-schema.cmd="docker run [-d|-it] --init --rm -p [<ipaddr>:]<host port>:5555 [--name ab-netcat] [-e TZ=timezone] docker.asifbacchus.app/ab-netcat [/bin/sh]"
|
LABEL org.label-schema.cmd="docker run --rm docker.asifbacchus.app/ab-netcat help"
|
||||||
LABEL org.label-schema.description="Persistent netcat (BSD) echo server on Alpine Linux"
|
LABEL org.label-schema.description="Persistent netcat (BSD) listen server on Alpine Linux"
|
||||||
LABEL org.label-schema.name="ab-netcat"
|
LABEL org.label-schema.name="ab-netcat"
|
||||||
LABEL org.label-schema.schema-version="1.0"
|
LABEL org.label-schema.schema-version="1.0"
|
||||||
LABEL org.label-schema.url="https://git.asifbacchus.app/ab-docker/ab-netcat"
|
LABEL org.label-schema.url="https://git.asifbacchus.app/ab-docker/ab-netcat"
|
||||||
|
|||||||
@@ -1,3 +1,15 @@
|
|||||||
# ab-netcat
|
# ab-netcat
|
||||||
|
|
||||||
Simple netcat echo server on customizable port
|
Simple BSD-style netcat (NC) persistent "listen" server running on Alpine Linux. Run `docker run --rm docker.asifbacchus.app/ab-netcat help` for a quick-reference usage overview.
|
||||||
|
|
||||||
|
## Container usage
|
||||||
|
|
||||||
|
General usage:
|
||||||
|
|
||||||
|
`docker run [-d|-it] --init --rm -p [<ipaddr>:]<host port>:5555 [--name ab-netcat] [-e TZ=timezone] docker.asifbacchus.app/ab-netcat [/bin/sh]`
|
||||||
|
|
||||||
|
Please consult the repo [wiki](https://git.asifbacchus.app/ab-docker/ab-netcat/wiki) for detailed usage instructions and notes.
|
||||||
|
|
||||||
|
## Questions, Suggestions or Comments
|
||||||
|
|
||||||
|
Please create an issue if anything needs to be fixed or you have suggestions for enhancements. Otherwise, I hope it's useful to you!
|
||||||
|
|||||||
+23
-1
@@ -4,6 +4,28 @@
|
|||||||
### run supplied CMD
|
### run supplied CMD
|
||||||
#
|
#
|
||||||
|
|
||||||
exec "$@"
|
convertCase () {
|
||||||
|
printf "%s" "$1" | tr "[:upper:]" "[:lower:]"
|
||||||
|
}
|
||||||
|
|
||||||
|
# check if requesting help
|
||||||
|
isHELP=$( convertCase "$1" )
|
||||||
|
if [ "$isHELP" = 'help' ]; then
|
||||||
|
# display help
|
||||||
|
printf "\n\n--- ab-netcat usage ---\n\n"
|
||||||
|
printf "This container can be run in several ways, more details in the repo wiki at https://git.asifbacchus.app/ab-docker/ab-netcat/wiki\n\n"
|
||||||
|
printf "In all cases, this container is a persistent listener. General execution is:\n"
|
||||||
|
printf "docker run [-d|-it] --init --rm -p [<ipaddr>:]<host port>:5555 [--name ab-netcat] [-e TZ=timezone] docker.asifbacchus.app/ab-netcat\n\n"
|
||||||
|
printf "neither '-d' or '-it': Run in the foreground and display what's being received.\n\n"
|
||||||
|
printf "'-d': Run detached, you will have to run 'docker logs -f ab-netcat' to see what the container is receiving from connected client(s).\n\n"
|
||||||
|
printf "'-it': Run interactively. You can respond to clients or even chat :-)\n\n"
|
||||||
|
printf "'--init': This allows you to use ctrl-c to terminate container instead of having to run 'docker stop ab-netcat' or 'docker rm -f ab-netcat'. Only useful when running in the foreground or interactively.\n\n"
|
||||||
|
printf "'-e TZ=timezone': The container will default to UTC time, but you can change it using this environment variable. Ex: '-e TZ=America/Edmonton'\n\n"
|
||||||
|
printf "You can run the container and supply '/bin/sh' after the container name if you want to be dumped to a shell instead of automatically running netcat. If you're doing that, remember to also pass '-it':\n"
|
||||||
|
printf "Ex: docker run -it --rm -p 127.0.0.1:5555:5555 docker.asifbacchus.app/ab-netcat /bin/sh\n"
|
||||||
|
printf "\n--- end of help ---\n\n"
|
||||||
|
else
|
||||||
|
exec "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
#EOF
|
#EOF
|
||||||
Reference in New Issue
Block a user