You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
I the dockerignore file exclamation mark with the pattern ** isn't including all sub directories's files but only the top level one.
This issue prevent building a dockerignore file that allow coping of only specific extensions.
I'm not sure if it is the intended behaviour or not but I didn't see it documented anywhere.
Describe the results you received:
only top_level_python_file.py is copied and not subdir_python_file.py
Describe the results you expected:
I expected all the files ending with .py to be copied.
Additional information you deem important (e.g. issue happens only occasionally):
The same happens where the pattern is !subdir/**/*.py. In such case the file subdir/another_subdir/subdir_python_file.py also won't be copied.
I think it happens because the code in archive.go that check for prefix of the pattern and not use the pattern regex
dirSlash:=relFilePath+string(filepath.Separator)
for_, pat:=rangepm.Patterns() {
if!pat.Exclusion() {
continue
}
ifstrings.HasPrefix(pat.String()+string(filepath.Separator), dirSlash) {
// found a match - so can't skip this dirreturnnil
}
}
I will be happy to suggest a patch if you think this issue is indeed a bug and not the intended behaviour.
Output of docker version:
Client: Docker Engine - Community
Cloud integration: 1.0.4
Version: 20.10.2
API version: 1.41
Go version: go1.13.15
Git commit: 2291f61
Built: Mon Dec 28 16:12:42 2020
OS/Arch: darwin/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.2
API version: 1.41 (minimum version 1.12)
Go version: go1.13.15
Git commit: 8891c58
Built: Mon Dec 28 16:15:23 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.4.3
GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b
runc:
Version: 1.0.0-rc92
GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
docker-init:
Version: 0.19.0
GitCommit: de40ad0
The text was updated successfully, but these errors were encountered:
roi-meir
changed the title
Exclamation mark with the pattern ** isn't including all sub directories's files but only the top level one.
Exclamation mark with the pattern ** isn't including all sub directories's files but only the top level one
Jan 7, 2021
roi-meir
changed the title
Exclamation mark with the pattern ** isn't including all sub directories's files but only the top level one
dockerignore: Exclamation mark with the pattern ** isn't including all sub directories's files but only the top level one
Jan 7, 2021
Description
I the dockerignore file exclamation mark with the pattern
**
isn't including all sub directories's files but only the top level one.This issue prevent building a dockerignore file that allow coping of only specific extensions.
I'm not sure if it is the intended behaviour or not but I didn't see it documented anywhere.
Steps to reproduce the issue:
COPY . .
Describe the results you received:
only
top_level_python_file.py
is copied and notsubdir_python_file.py
Describe the results you expected:
I expected all the files ending with
.py
to be copied.Additional information you deem important (e.g. issue happens only occasionally):
The same happens where the pattern is
!subdir/**/*.py
. In such case the filesubdir/another_subdir/subdir_python_file.py
also won't be copied.I think it happens because the code in
archive.go
that check for prefix of the pattern and not use the pattern regexI will be happy to suggest a patch if you think this issue is indeed a bug and not the intended behaviour.
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: