Skipping empty lines in .dockerignore

Docker-DCO-1.1-Signed-off-by: Ian Babrou <ibobrik@gmail.com> (github: bobrik)
Upstream-commit: 1a1ee73e38eb54f9b5a3fd03f98c4bb80dde1bbb
Component: engine
This commit is contained in:
Ian Babrou
2014-07-12 13:38:33 +04:00
parent c1ad27879c
commit f47a491cb1

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)