From 7d7fa99b2169a76da59981020b30f57de8b3f208 Mon Sep 17 00:00:00 2001 From: Adam Ross Date: Wed, 29 May 2019 15:38:52 -0700 Subject: [PATCH 1/6] service/samples: add .dockerignore to samples with risk of local build interference --- .../hello-world/helloworld-csharp/.dockerignore | 4 ++++ .../samples/hello-world/helloworld-csharp/README.md | 9 +++++++++ .../hello-world/helloworld-nodejs/.dockerignore | 4 ++++ .../samples/hello-world/helloworld-nodejs/README.md | 9 +++++++++ .../samples/hello-world/helloworld-php/.dockerignore | 3 +++ .../samples/hello-world/helloworld-php/README.md | 8 ++++++++ .../hello-world/helloworld-python/.dockerignore | 6 ++++++ .../samples/hello-world/helloworld-python/README.md | 11 +++++++++++ 8 files changed, 54 insertions(+) create mode 100644 docs/serving/samples/hello-world/helloworld-csharp/.dockerignore create mode 100644 docs/serving/samples/hello-world/helloworld-nodejs/.dockerignore create mode 100644 docs/serving/samples/hello-world/helloworld-php/.dockerignore create mode 100644 docs/serving/samples/hello-world/helloworld-python/.dockerignore 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..b65ea5100ca 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. Add a `.dockerignore` file to ensure local builds cannot disrupt container builds. + + ```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..0f5805da91d 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. Add a `.dockerignore` file to ensure local builds cannot disrupt container builds. + + ```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..f9b3d994509 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. Add a `.dockerignore` file to ensure local builds cannot disrupt container builds. + + ```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..0a8ececd4d6 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. Add a `.dockerignore` file to ensure local builds cannot disrupt container builds. + + ```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. From 0d4f39874d836a2a2b2a215f72c39f5b10ccc167 Mon Sep 17 00:00:00 2001 From: Adam Ross Date: Thu, 30 May 2019 13:04:10 -0700 Subject: [PATCH 2/6] serving/samples: .dockerignore readme text update --- docs/serving/samples/hello-world/helloworld-csharp/README.md | 2 +- docs/serving/samples/hello-world/helloworld-nodejs/README.md | 2 +- docs/serving/samples/hello-world/helloworld-php/README.md | 2 +- docs/serving/samples/hello-world/helloworld-python/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/serving/samples/hello-world/helloworld-csharp/README.md b/docs/serving/samples/hello-world/helloworld-csharp/README.md index b65ea5100ca..e3244b03521 100644 --- a/docs/serving/samples/hello-world/helloworld-csharp/README.md +++ b/docs/serving/samples/hello-world/helloworld-csharp/README.md @@ -87,7 +87,7 @@ cd knative-docs/serving/samples/hello-world/helloworld-csharp CMD ["dotnet", "out/helloworld-csharp.dll"] ``` -1. Add a `.dockerignore` file to ensure local builds cannot disrupt container builds. +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 diff --git a/docs/serving/samples/hello-world/helloworld-nodejs/README.md b/docs/serving/samples/hello-world/helloworld-nodejs/README.md index 0f5805da91d..2780080d4f0 100644 --- a/docs/serving/samples/hello-world/helloworld-nodejs/README.md +++ b/docs/serving/samples/hello-world/helloworld-nodejs/README.md @@ -110,7 +110,7 @@ cd knative-docs/serving/samples/hello-world/helloworld-nodejs CMD [ "npm", "start" ] ``` -1. Add a `.dockerignore` file to ensure local builds cannot disrupt container builds. +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 diff --git a/docs/serving/samples/hello-world/helloworld-php/README.md b/docs/serving/samples/hello-world/helloworld-php/README.md index f9b3d994509..f407045360b 100644 --- a/docs/serving/samples/hello-world/helloworld-php/README.md +++ b/docs/serving/samples/hello-world/helloworld-php/README.md @@ -57,7 +57,7 @@ cd knative-docs/serving/samples/hello-world/helloworld-php RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" ``` -1. Add a `.dockerignore` file to ensure local builds cannot disrupt container builds. +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 diff --git a/docs/serving/samples/hello-world/helloworld-python/README.md b/docs/serving/samples/hello-world/helloworld-python/README.md index 0a8ececd4d6..40e20820bbb 100644 --- a/docs/serving/samples/hello-world/helloworld-python/README.md +++ b/docs/serving/samples/hello-world/helloworld-python/README.md @@ -70,7 +70,7 @@ cd knative-docs/serving/samples/hello-world/helloworld-python CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 app:app ``` -1. Add a `.dockerignore` file to ensure local builds cannot disrupt container builds. +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 From df2d8b47fb600aee6545f63dce414fce1b1af6ba Mon Sep 17 00:00:00 2001 From: Adam Ross Date: Thu, 30 May 2019 16:05:19 -0700 Subject: [PATCH 3/6] Update docs/serving/samples/hello-world/helloworld-csharp/README.md Co-Authored-By: RichieEscarez --- docs/serving/samples/hello-world/helloworld-csharp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/serving/samples/hello-world/helloworld-csharp/README.md b/docs/serving/samples/hello-world/helloworld-csharp/README.md index e3244b03521..0b0e28edf47 100644 --- a/docs/serving/samples/hello-world/helloworld-csharp/README.md +++ b/docs/serving/samples/hello-world/helloworld-csharp/README.md @@ -87,7 +87,7 @@ 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. +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 From 39c12114cd9c6b4075b14a43d7ddd128ad77f5cb Mon Sep 17 00:00:00 2001 From: Adam Ross Date: Thu, 30 May 2019 16:05:29 -0700 Subject: [PATCH 4/6] Update docs/serving/samples/hello-world/helloworld-nodejs/README.md Co-Authored-By: RichieEscarez --- docs/serving/samples/hello-world/helloworld-nodejs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/serving/samples/hello-world/helloworld-nodejs/README.md b/docs/serving/samples/hello-world/helloworld-nodejs/README.md index 2780080d4f0..7dbbaacc7de 100644 --- a/docs/serving/samples/hello-world/helloworld-nodejs/README.md +++ b/docs/serving/samples/hello-world/helloworld-nodejs/README.md @@ -110,7 +110,7 @@ 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. +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 From b0f9d60091e93de106b1b5a57de4cd7759457f29 Mon Sep 17 00:00:00 2001 From: Adam Ross Date: Thu, 30 May 2019 16:05:39 -0700 Subject: [PATCH 5/6] Update docs/serving/samples/hello-world/helloworld-python/README.md Co-Authored-By: RichieEscarez --- docs/serving/samples/hello-world/helloworld-python/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/serving/samples/hello-world/helloworld-python/README.md b/docs/serving/samples/hello-world/helloworld-python/README.md index 40e20820bbb..721a795c0be 100644 --- a/docs/serving/samples/hello-world/helloworld-python/README.md +++ b/docs/serving/samples/hello-world/helloworld-python/README.md @@ -70,7 +70,7 @@ 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. +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 From e607e5ead0b260d736bd9522b8baaac7cb7c8728 Mon Sep 17 00:00:00 2001 From: Adam Ross Date: Thu, 30 May 2019 16:05:53 -0700 Subject: [PATCH 6/6] Update docs/serving/samples/hello-world/helloworld-php/README.md Co-Authored-By: Evan Anderson --- docs/serving/samples/hello-world/helloworld-php/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/serving/samples/hello-world/helloworld-php/README.md b/docs/serving/samples/hello-world/helloworld-php/README.md index f407045360b..79de8ebec35 100644 --- a/docs/serving/samples/hello-world/helloworld-php/README.md +++ b/docs/serving/samples/hello-world/helloworld-php/README.md @@ -57,7 +57,7 @@ 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. +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