Skip to content

Commit 41183c2

Browse files
authored
Merge pull request #4514 from thaJeztah/patternmatcher_dockerignore
replace dockerfile/dockerignore with patternmatcher/ignorefile
2 parents c7a3a30 + 5bff123 commit 41183c2

5 files changed

Lines changed: 29 additions & 16 deletions

File tree

cli/command/image/build/dockerignore.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package build
22

33
import (
4+
"fmt"
45
"os"
56
"path/filepath"
67

7-
"github.com/moby/buildkit/frontend/dockerfile/dockerignore"
88
"github.com/moby/patternmatcher"
9+
"github.com/moby/patternmatcher/ignorefile"
910
)
1011

1112
// ReadDockerignore reads the .dockerignore file in the context directory and
@@ -22,7 +23,11 @@ func ReadDockerignore(contextDir string) ([]string, error) {
2223
}
2324
defer f.Close()
2425

25-
return dockerignore.ReadAll(f)
26+
patterns, err := ignorefile.ReadAll(f)
27+
if err != nil {
28+
return nil, fmt.Errorf("error reading .dockerignore: %w", err)
29+
}
30+
return patterns, nil
2631
}
2732

2833
// TrimBuildFilesFromExcludes removes the named Dockerfile and .dockerignore from

vendor.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ require (
2323
github.com/mattn/go-runewidth v0.0.14
2424
github.com/mitchellh/mapstructure v1.3.2
2525
github.com/moby/buildkit v0.11.6
26-
github.com/moby/patternmatcher v0.5.0
26+
github.com/moby/patternmatcher v0.6.0
2727
github.com/moby/swarmkit/v2 v2.0.0-20230713153928-bc71908479e5
2828
github.com/moby/sys/sequential v0.5.0
2929
github.com/moby/sys/signal v0.7.0

vendor.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ github.com/mitchellh/mapstructure v1.3.2 h1:mRS76wmkOn3KkKAyXDu42V+6ebnXWIztFSYG
154154
github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
155155
github.com/moby/buildkit v0.11.6 h1:VYNdoKk5TVxN7k4RvZgdeM4GOyRvIi4Z8MXOY7xvyUs=
156156
github.com/moby/buildkit v0.11.6/go.mod h1:GCqKfHhz+pddzfgaR7WmHVEE3nKKZMMDPpK8mh3ZLv4=
157-
github.com/moby/patternmatcher v0.5.0 h1:YCZgJOeULcxLw1Q+sVR636pmS7sPEn1Qo2iAN6M7DBo=
158-
github.com/moby/patternmatcher v0.5.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
157+
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
158+
github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc=
159159
github.com/moby/swarmkit/v2 v2.0.0-20230713153928-bc71908479e5 h1:o6x+wIX1vKD0kJlEqe8M9TLIe0SK8lnGcA6XoJtaFqg=
160160
github.com/moby/swarmkit/v2 v2.0.0-20230713153928-bc71908479e5/go.mod h1:XUMlwIIC+wrwBDMUjxEvk5Z8FPoIPM8LdBw7w/Zu1rg=
161161
github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=

vendor/github.com/moby/buildkit/frontend/dockerfile/dockerignore/dockerignore.go renamed to vendor/github.com/moby/patternmatcher/ignorefile/ignorefile.go

Lines changed: 17 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ github.com/miekg/pkcs11
167167
github.com/mitchellh/mapstructure
168168
# github.com/moby/buildkit v0.11.6
169169
## explicit; go 1.18
170-
github.com/moby/buildkit/frontend/dockerfile/dockerignore
171170
github.com/moby/buildkit/util/appcontext
172-
# github.com/moby/patternmatcher v0.5.0
171+
# github.com/moby/patternmatcher v0.6.0
173172
## explicit; go 1.19
174173
github.com/moby/patternmatcher
174+
github.com/moby/patternmatcher/ignorefile
175175
# github.com/moby/swarmkit/v2 v2.0.0-20230713153928-bc71908479e5
176176
## explicit; go 1.18
177177
github.com/moby/swarmkit/v2/api

0 commit comments

Comments
 (0)