Skip to content

Instantly share code, notes, and snippets.

@jpetazzo
Created October 28, 2014 05:50
Show Gist options
  • Save jpetazzo/b76576ad5c63aa42992e to your computer and use it in GitHub Desktop.
Save jpetazzo/b76576ad5c63aa42992e to your computer and use it in GitHub Desktop.
  1. Start container
  2. Create view.sh
  3. Create a FIFO with mkfifo /tmp/view
  4. Have a writer on the FIFO: just leave cat >/tmp/view running somewhere
  5. Run socat TCP-LISTEN:8080,reuseaddr,fork EXEC:/path/to/view.sh
  6. Whenever you want to kick everybody out, you can kill socat or kill the cat process :-)
#!/bin/sh
echo "Content-Type: text/plain"
echo ""
docker attach $CONTAINER_ID_OR_NAME </tmp/view
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment