diff --git a/content/build/building/packaging.md b/content/build/building/packaging.md index 310751bc7e..ec3e80a495 100644 --- a/content/build/building/packaging.md +++ b/content/build/building/packaging.md @@ -92,7 +92,7 @@ COPY hello.py / # final configuration ENV FLASK_APP=hello EXPOSE 8000 -CMD flask run --host 0.0.0.0 --port 8000 +CMD ["flask", "run", "--host", "0.0.0.0", "--port", "8000"] ``` Here's a breakdown of what this Dockerfile does: @@ -234,12 +234,22 @@ team members understand what this application is doing. Finally, [`CMD` instruction](../../engine/reference/builder.md#cmd) sets the command that is run when the user starts a container based on this image. +```dockerfile +CMD ["flask", "run", "--host", "0.0.0.0", "--port", "8000"] +``` + +This command starts the flask development server listening on all addresses +on port `8000`. The example here uses the "exec form" version of `CMD`. +It's also possible to use the "shell form": + ```dockerfile CMD flask run --host 0.0.0.0 --port 8000 ``` -In this case we'll start the flask development server listening on all addresses -on port `8000`. +There are subtle differences between these two versions, +for example in how they trap signals like `SIGTERM` and `SIGKILL`. +For more information about these differences, see +[Shell and exec form](../../engine/reference/builder.md#shell-and-exec-form) ## Building