duedil-ltd/portainer

Incorrect handling of .dockerignore files

Opened this issue · 0 comments

orls commented

Currently, portainer only handles .dockerignore files inside directories that are being ADD/COPY'd, and does so recursively.

However, that's not the correct behaviour for dockerfiles according to the docs – there should be just one dockerignore in the root path of the build (essentially, next to the Dockerfile).

Dockerignores are an important weapon against bloat – both in the size of layers, and the time that can be saved shipping around potentially massive context that aren't wanted (.git directories, for example)

While we're at it, we should probably check how well python's fnmatch compares to Go's filepath.match and docker's additional gitignore-esque ! for exclusions, too, make sure we're correctly handling .dockerignore content, too...at a glance, I'm not sure exclusions are well-handled