* Docs: update sample application initiation in venv
Until now, readers would install 'Flask' on their main system
python environment, freeze their entire packages, and grep only
the 'Flask' package! So they would be missing all the other
dependencies in their requirements file.
With this commit, a better practice is followed. First, create a
clean virtual environment, then install 'Flask' and freeze
everything into the requirements file.
Also, I recommend using 'python3 -m pip freeze' instead of 'pip3
freeze' while in the virtual environment. This is because
sometimes hidden quirks of 'pip' will ignore the actiavted
environment and freeze the entire python packages in the
system (e.g. in ArchLinux).
* Docs: update python sample testing application
In the previous commit, I forgot to update the 'Test the
application' section so that the users activate the virtual
environment first.
This commit fixes that.
Co-authored-by: Stefan Scherer <stefan.scherer@docker.com>
- To reduce the error prone process of grabbing all Python packages in the global Python scope, the specific package is extracted and set in to the requirements.txt file
BuildKit allows using alternative Dockerfile syntaxes to introduce new features
without having to update Docker itself. The general recommendation is to always
specify a "syntax" directive in a Dockerfile, so that (if needed) older versions
of Docker can download the correct syntax to build the Dockerfile.
This updates our examples to include a syntax directive, to make users more familiar
with these directives, and to illustrate best-pracitces in our documentation.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Replaced `docker-python` directory reference with `python-docker` to reduce confusion when following the tutorial. The tutorial establishes creating a `python-docker` directory, so proposing this change to maintain consistency with instructions.
* Fix CMD arguments
The previous CMD command doesn't actually start the service.
* Simplify (and fix) curl command
Previously it was specifying a lot of parameters that in our case are optional and IMO don't help with understanding what's going on.
Furthermore the previous command was asking for a `/test` page which we do not serve.
And finally it was using POST which is not supported in our app created in the previous step.
* Fix typo