I had a problem with the accepted answer, in which problems with the network prevented me from starting the apt-get update on my corporate network.
However, the following Dockerfile worked, and I find it lighter than the ubuntu image, for something as simple as sharing static html files.
FROM python:3.6.0-alpine ADD static/ /src WORKDIR /src EXPOSE 8080 ENTRYPOINT ["python3", "-m", "http.server", "8080"]
Also, since this relates to the first question, will the following not work? I'm not sure I understand the advantage of hacking a command into an array.
CMD python3 -m http.server 8080
source share