diff --git a/docs/serving/samples/hello-world/helloworld-python/Dockerfile b/docs/serving/samples/hello-world/helloworld-python/Dockerfile index f33c7710b..a84faddcb 100644 --- a/docs/serving/samples/hello-world/helloworld-python/Dockerfile +++ b/docs/serving/samples/hello-world/helloworld-python/Dockerfile @@ -2,6 +2,9 @@ # https://hub.docker.com/_/python FROM python:3.7-slim +# Allow statements and log messages to immediately appear in the Knative logs +ENV PYTHONUNBUFFERED True + # Copy local code to the container image. ENV APP_HOME /app WORKDIR $APP_HOME diff --git a/docs/serving/samples/hello-world/helloworld-python/README.md b/docs/serving/samples/hello-world/helloworld-python/README.md index 04ee061ba..94cf4eb4d 100644 --- a/docs/serving/samples/hello-world/helloworld-python/README.md +++ b/docs/serving/samples/hello-world/helloworld-python/README.md @@ -55,6 +55,9 @@ cd knative-docs/docs/serving/samples/hello-world/helloworld-python # https://hub.docker.com/_/python FROM python:3.7-slim + # Allow statements and log messages to immediately appear in the Knative logs + ENV PYTHONUNBUFFERED True + # Copy local code to the container image. ENV APP_HOME /app WORKDIR $APP_HOME