cli icon indicating copy to clipboard operation
cli copied to clipboard

[UX] Changes in func.yaml must not always trigger docker to rebuild image cached layers

Open denismakogon opened this issue 5 years ago • 0 comments

Here's the thing, in most of the lang helpers we do:

ADD . <somwhere>

"dot" means include all files within current directory. So, when I modify a file within this directory Docker will rebuild image layers because "something changed" from the previous state of the layers.

However, not all changes must trigger docker to rebuild image layers from scratch. And this type of change is any modification to func.yaml.

Certain changes in that file will definitely force docker to rebuild an image (like versioning that is related to an image tagging, entrypoint change, etc.). But not all changes must force docker to invalidate previous image state (like if I would add more memory in func.yaml and call a fn build).

So, I want to say that any change to func.yaml must not be a reason to make docker to rebuild an image leaving previous dangling images out there as a trash (honestly, i do have a script that I ran on weekdays to cleaup dangling docker images that were populated by redandant function deploys/builds).

A good way to solve this is to add .dockerignore to the boilerplate. Maybe something else. don't know.

denismakogon avatar Oct 29 '18 12:10 denismakogon