1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #6991 from bobrik/empty-dockerignore

Skipping empty lines in .dockerignore
This commit is contained in:
Michael Crosby 2014-07-16 10:46:38 -07:00
commit 1583e7af41

View file

@ -171,6 +171,10 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
return fmt.Errorf("Error reading .dockerignore: '%s'", err)
} else if err == nil {
for _, pattern := range strings.Split(string(ignore), "\n") {
if pattern == "" {
continue
}
ok, err := filepath.Match(pattern, "Dockerfile")
if err != nil {
utils.Errorf("Bad .dockerignore pattern: '%s', error: %s", pattern, err)