Skip to content

Incorrect handling of .dockerignore files #41

@orls

Description

@orls

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions