service/samples: add .dockerignore to samples with local build disruption risk#1392
Conversation
|
/cc @steren |
|
the _index.md file in each folder is for the website build, does that need to be ignored too? |
|
That's a fantastic question Richie. In the interests of making this a light touch (it borders on going too far for a helloworld/quickstart), my take is that we should not include _index.md or other elements of the knative/docs repo itself. If we find there are real performance gains to be had, we can patch in some additional .dockerignore lines as part of the CI process. |
| CMD ["dotnet", "out/helloworld-csharp.dll"] | ||
| ``` | ||
|
|
||
| 1. Add a `.dockerignore` file to ensure local builds cannot disrupt container builds. |
There was a problem hiding this comment.
Why tell folks to add a .dockerignore file since you added it already. If they clone the source code they will have the file already there.
There was a problem hiding this comment.
We don't tell them to clone the source code, we tell them to assemble the files through CLI scaffolding and copy & paste.
There was a problem hiding this comment.
| 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. |
Can we make this change throughout?
RichieEscarez
left a comment
There was a problem hiding this comment.
One global change requested, otherwise looks good to me.
|
One global change applied. |
RichieEscarez
left a comment
There was a problem hiding this comment.
/approve
Looking for an LGTM from a SME, please
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: grayside, RichieEscarez The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
evankanderson
left a comment
There was a problem hiding this comment.
/lgtm
/hold
One question on grammar that I'm not sure about, and a request whether technical assistance is available.
|
|
||
| 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 |
There was a problem hiding this comment.
Is there any way to do some fancy server-side include magic here rather than needing to repeat the content?
There was a problem hiding this comment.
for the rendered content on the site, yes we have a few options (ie. using Hugo variables to inject chunks of content). the downside is that when the content is viewed in GitHub, its no longer legible (more difficult for authors or one-off contributors, especially those who use the GitHub WYSIWYG UI). im toying with the idea of getting our Netlify builds to run on demand (therefore the authoring process / PR review and merge steps would include running a "test build" to render and verify the output) but that too adds to the overhead of contributing. I think the first place we want to start to implement "content reuse" and "single sourcing" are for the multiple install guides
we should chat more if you have ideas here?
There was a problem hiding this comment.
for the rendered content on the site, yes we have a few options (ie. using Hugo variables to inject chunks of content). the downside is that when the content is viewed in GitHub, its no longer legible (more difficult for authors or one-off contributors, especially those who use the GitHub WYSIWYG UI). im toying with the idea of getting our Netlify builds to run on demand (therefore the authoring process / PR review and merge steps would include running a "test build" to render and verify the output) but that too adds to the overhead of contributing. I think the first place we want to start to implement "content reuse" and "single sourcing" are for the multiple install guides
we should chat more if you have ideas here?
I would like something like SSI Include syntax:
<!--#include file="included.html" -->
Which seems like it would be fairly natural to read. But I don't know if Hugo has that capability.
Co-Authored-By: RichieEscarez <rescarez@google.com>
Co-Authored-By: RichieEscarez <rescarez@google.com>
Co-Authored-By: RichieEscarez <rescarez@google.com>
Co-Authored-By: Evan Anderson <evan.k.anderson@gmail.com>
|
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the ℹ️ Googlers: Go here for more info. |
|
Comma extraction is complete. Thanks for using the suggestion feature! |
|
/lgtm |
|
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) ℹ️ Googlers: Go here for more info. |
|
/hold cancel |
…tion risk (knative#1392) * service/samples: add .dockerignore to samples with risk of local build interference * serving/samples: .dockerignore readme text update * Update docs/serving/samples/hello-world/helloworld-csharp/README.md Co-Authored-By: RichieEscarez <rescarez@google.com> * Update docs/serving/samples/hello-world/helloworld-nodejs/README.md Co-Authored-By: RichieEscarez <rescarez@google.com> * Update docs/serving/samples/hello-world/helloworld-python/README.md Co-Authored-By: RichieEscarez <rescarez@google.com> * Update docs/serving/samples/hello-world/helloworld-php/README.md Co-Authored-By: Evan Anderson <evan.k.anderson@gmail.com>
* pr#1408 * pr#1398 * service/samples: add .dockerignore to samples with local build disruption risk (#1392) * service/samples: add .dockerignore to samples with risk of local build interference * serving/samples: .dockerignore readme text update * Update docs/serving/samples/hello-world/helloworld-csharp/README.md Co-Authored-By: RichieEscarez <rescarez@google.com> * Update docs/serving/samples/hello-world/helloworld-nodejs/README.md Co-Authored-By: RichieEscarez <rescarez@google.com> * Update docs/serving/samples/hello-world/helloworld-python/README.md Co-Authored-By: RichieEscarez <rescarez@google.com> * Update docs/serving/samples/hello-world/helloworld-php/README.md Co-Authored-By: Evan Anderson <evan.k.anderson@gmail.com> * Fix the wrong information in grpc example (#1380) * pr#1363 * Fix samples path (#1357) * Copy the updates from knative/eventing#1241. (#1355) * add reference to custom DNS config (#1327) * add reference to custom DNS config * Update docs/install/getting-started-knative-app.md Co-Authored-By: Sam O'Dell <31352624+samodell@users.noreply.github.com> * fix relative link * Fix PR#1202 * Document serving tag resolution (#1260) Our controller does resolution of tags to digests, which has been a source of confusion. This documents the fact that we do it, why we do it, and how to configure the controller to work around common issues.
Problem
If someone runs a local build in these samples, it will generate files that will make their way into the container. Once there, these files can interfere with the build.
Files unrelated to the application itself such as the
DockerfileorREADME.mdcan excessively reset the layer cache.Proposed Changes
.dockerignorefor serving samples subject to (1), with language-specific exclusions of generated files. This includes: Python, C#, PHP, Nodejs