.dockerignore - exclude directory except certain file-types

Viewed 391

I have a .dockerignore file in which I want to exclude the entire directory /src except all .json files in that /src-Directory.

My current approach looks like this:

/src/*
!/src/**/*.json

I have also tried using /src instead of /src/*, but in both cases is the entire directory excluded and the JSON files are nowhere to be found.

1 Answers
Related