diff --git a/builder/dockerfile/copy.go b/builder/dockerfile/copy.go index d657cfbffb..6d8b19beb1 100644 --- a/builder/dockerfile/copy.go +++ b/builder/dockerfile/copy.go @@ -251,19 +251,6 @@ func (o *copier) calcCopyInfo(origPath string, allowWildcards bool) ([]copyInfo, return newCopyInfos(newCopyInfoFromSource(o.source, origPath, hash)), nil } -func containsWildcards(name string) bool { - isWindows := runtime.GOOS == "windows" - for i := 0; i < len(name); i++ { - ch := name[i] - if ch == '\\' && !isWindows { - i++ - } else if ch == '*' || ch == '?' || ch == '[' { - return true - } - } - return false -} - func (o *copier) storeInPathCache(im *imageMount, path string, hash string) { if im != nil { o.pathCache.Store(im.ImageID()+path, hash) diff --git a/builder/dockerfile/copy_unix.go b/builder/dockerfile/copy_unix.go index ea3b182308..bccc5b9ef7 100644 --- a/builder/dockerfile/copy_unix.go +++ b/builder/dockerfile/copy_unix.go @@ -43,6 +43,18 @@ func fixPermissions(source, destination string, identity idtools.Identity, overr }) } +func containsWildcards(name string) bool { + for i := 0; i < len(name); i++ { + ch := name[i] + if ch == '\\' { + i++ + } else if ch == '*' || ch == '?' || ch == '[' { + return true + } + } + return false +} + func validateCopySourcePath(imageSource *imageMount, origPath string) error { return nil } diff --git a/builder/dockerfile/copy_windows.go b/builder/dockerfile/copy_windows.go index 00c624d67a..247a6663b8 100644 --- a/builder/dockerfile/copy_windows.go +++ b/builder/dockerfile/copy_windows.go @@ -79,6 +79,16 @@ func fixPermissionsWindows(source, destination, SID string) error { return windows.SetNamedSecurityInfo(destination, windows.SE_FILE_OBJECT, windows.OWNER_SECURITY_INFORMATION|windows.DACL_SECURITY_INFORMATION, sid, nil, dacl, nil) } +func containsWildcards(name string) bool { + for i := 0; i < len(name); i++ { + ch := name[i] + if ch == '*' || ch == '?' || ch == '[' { + return true + } + } + return false +} + func validateCopySourcePath(imageSource *imageMount, origPath string) error { if imageSource == nil { return nil