diff --git a/docs/serving/samples/hello-world/helloworld-csharp/.dockerignore b/docs/serving/samples/hello-world/helloworld-csharp/.dockerignore new file mode 100644 index 00000000000..ee5e6f9ea69 --- /dev/null +++ b/docs/serving/samples/hello-world/helloworld-csharp/.dockerignore @@ -0,0 +1,4 @@ +Dockerfile +README.md +**/obj/ +**/bin/ diff --git a/docs/serving/samples/hello-world/helloworld-csharp/README.md b/docs/serving/samples/hello-world/helloworld-csharp/README.md index 65ab26277df..0b0e28edf47 100644 --- a/docs/serving/samples/hello-world/helloworld-csharp/README.md +++ b/docs/serving/samples/hello-world/helloworld-csharp/README.md @@ -87,6 +87,15 @@ cd knative-docs/serving/samples/hello-world/helloworld-csharp CMD ["dotnet", "out/helloworld-csharp.dll"] ``` +1. Create a `.dockerignore` file to ensure that any files related to a local build do not affect the container that you build for deployment. + + ```ignore + Dockerfile + README.md + **/obj/ + **/bin/ + ``` + 1. Create a new file, `service.yaml` and copy the following service definition into the file. Make sure to replace `{username}` with your Docker Hub username. diff --git a/docs/serving/samples/hello-world/helloworld-nodejs/.dockerignore b/docs/serving/samples/hello-world/helloworld-nodejs/.dockerignore new file mode 100644 index 00000000000..07efc8ee247 --- /dev/null +++ b/docs/serving/samples/hello-world/helloworld-nodejs/.dockerignore @@ -0,0 +1,4 @@ +Dockerfile +README.md +node_modules +npm-debug.log diff --git a/docs/serving/samples/hello-world/helloworld-nodejs/README.md b/docs/serving/samples/hello-world/helloworld-nodejs/README.md index 7cb326cd3c1..7dbbaacc7de 100644 --- a/docs/serving/samples/hello-world/helloworld-nodejs/README.md +++ b/docs/serving/samples/hello-world/helloworld-nodejs/README.md @@ -110,6 +110,15 @@ cd knative-docs/serving/samples/hello-world/helloworld-nodejs CMD [ "npm", "start" ] ``` +1. Create a `.dockerignore` file to ensure that any files related to a local build do not affect the container that you build for deployment. + + ```ignore + Dockerfile + README.md + node_modules + npm-debug.log + ``` + 1. Create a new file, `service.yaml` and copy the following service definition into the file. Make sure to replace `{username}` with your Docker Hub username. diff --git a/docs/serving/samples/hello-world/helloworld-php/.dockerignore b/docs/serving/samples/hello-world/helloworld-php/.dockerignore new file mode 100644 index 00000000000..5d2dbb3aabe --- /dev/null +++ b/docs/serving/samples/hello-world/helloworld-php/.dockerignore @@ -0,0 +1,3 @@ +Dockerfile +README.md +vendor diff --git a/docs/serving/samples/hello-world/helloworld-php/README.md b/docs/serving/samples/hello-world/helloworld-php/README.md index d0bf24b30d6..79de8ebec35 100644 --- a/docs/serving/samples/hello-world/helloworld-php/README.md +++ b/docs/serving/samples/hello-world/helloworld-php/README.md @@ -57,6 +57,14 @@ cd knative-docs/serving/samples/hello-world/helloworld-php RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" ``` +1. Create a `.dockerignore` file to ensure that any files related to a local build do not affect the container that you build for deployment. + + ```ignore + Dockerfile + README.md + vendor + ``` + 1. Create a new file, `service.yaml` and copy the following service definition into the file. Make sure to replace `{username}` with your Docker Hub username. diff --git a/docs/serving/samples/hello-world/helloworld-python/.dockerignore b/docs/serving/samples/hello-world/helloworld-python/.dockerignore new file mode 100644 index 00000000000..8c89c00bb1e --- /dev/null +++ b/docs/serving/samples/hello-world/helloworld-python/.dockerignore @@ -0,0 +1,6 @@ +Dockerfile +README.md +*.pyc +*.pyo +*.pyd +__pycache__ diff --git a/docs/serving/samples/hello-world/helloworld-python/README.md b/docs/serving/samples/hello-world/helloworld-python/README.md index 52c9b3a9f72..721a795c0be 100644 --- a/docs/serving/samples/hello-world/helloworld-python/README.md +++ b/docs/serving/samples/hello-world/helloworld-python/README.md @@ -70,6 +70,17 @@ cd knative-docs/serving/samples/hello-world/helloworld-python CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 app:app ``` +1. Create a `.dockerignore` file to ensure that any files related to a local build do not affect the container that you build for deployment. + + ```ignore + Dockerfile + README.md + *.pyc + *.pyo + *.pyd + __pycache__ + ``` + 1. Create a new file, `service.yaml` and copy the following service definition into the file. Make sure to replace `{username}` with your Docker Hub username.