November 2017
Intermediate to advanced
298 pages
7h 10m
English
We're nearly done! The last thing we need to do is start Python's built-in HTTP server module when our container starts:
CMD [ "python3", "-m", "http.server" ]
With everything in place, we can build and start our new container:
$ docker build -t python_server . Sending build context to Docker daemon 16.9kBStep 1/14 : FROM python:3 ---> 968120d8cbe8<snip>Step 14/14 : CMD python3 -m http.server ---> Running in 55262476f342 ---> 38fab9dca6cdRemoving intermediate container 55262476f342Successfully built 38fab9dca6cdSuccessfully tagged python_server:latest$ docker run -d \ -p 8000:8000 \ --rm \ python_server d19e9bf7fe70793d7fce49f3bd268917015167c51bd35d7a476feaac629c32b8
We can cross our fingers and check what we have ...
Read now
Unlock full access