Skip to content

Instantly share code, notes, and snippets.

@felixrabe
Last active August 29, 2015 14:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felixrabe/32d6f65876b79451fc55 to your computer and use it in GitHub Desktop.
Save felixrabe/32d6f65876b79451fc55 to your computer and use it in GitHub Desktop.
Simple webserver in Bash for Raspberry Pi using Docker
FROM sdhibit/rpi-raspbian
RUN apt-get update && apt-get install -y netcat-openbsd
RUN echo 'HTTP/1.1 200 OK' >> www
RUN echo 'Content-Type: text/html' >> www
RUN echo >> www
RUN echo '<h1>Hello <i>world!</i></h1>' >> www
EXPOSE 9999
CMD ["/bin/bash", "-c", "while true ; do nc -l 9999 < www > /dev/null ; done"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment