Created
June 19, 2019 07:59
-
-
Save dmlogv/b255f67af2a4aff27bad50c137f57fd7 to your computer and use it in GitHub Desktop.
Dockerfile with the one-line nc-based webserver
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM busybox:latest | |
ENV port=8081 | |
RUN \ | |
echo -e 'echo $port\n\nwhile true\ndo\n (echo -e "HTTP/1.1 200 OK\\nContent-Type: text/html\\n\\n<b>Hello World</b><br>Builded at $(date)";) | nc -vv -l -p $port\ndone' > server.sh \ | |
&& chmod +x server.sh \ | |
&& mkdir /var/log | |
EXPOSE 8081:8081 | |
ENTRYPOINT port=$port ./server.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment