Skip to content

Instantly share code, notes, and snippets.

@skuenzli
Last active February 5, 2019 23:06
Show Gist options
  • Save skuenzli/bf243a9ffe70960e288327743da8859c to your computer and use it in GitHub Desktop.
Save skuenzli/bf243a9ffe70960e288327743da8859c to your computer and use it in GitHub Desktop.
Simple Echo Service on Docker Swram
# Create an 'echo' service on a Swarm that replies back whatever you send it
docker service create --name echo --publish '8000:8' busybox:1.29 nc -v -lk -p 8 -e /bin/cat
# talk to the service, assuming you're on a Swarm node; change localhost to a Swarm node hostname if remote
echo "hello netcat my old friend..." | nc localhost -w 3 8000
echo "i've come to test connection behavior again." | nc localhost -w 3 8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment