From c840e7967f7815ff93929a8cd078884bc93c7117 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Sun, 18 Nov 2018 12:36:26 -0800 Subject: [PATCH] dockerfile: avoid urls in context filter Signed-off-by: Tonis Tiigi --- frontend/dockerfile/dockerfile2llb/convert.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/dockerfile/dockerfile2llb/convert.go b/frontend/dockerfile/dockerfile2llb/convert.go index 4c3a5262..c85cfe2c 100644 --- a/frontend/dockerfile/dockerfile2llb/convert.go +++ b/frontend/dockerfile/dockerfile2llb/convert.go @@ -469,7 +469,9 @@ func dispatch(d *dispatchState, cmd command, opt dispatchOpt) error { err = dispatchCopy(d, c.SourcesAndDest, opt.buildContext, true, c, "", opt) if err == nil { for _, src := range c.Sources() { - d.ctxPaths[path.Join("/", filepath.ToSlash(src))] = struct{}{} + if !strings.HasPrefix(src, "http://") && !strings.HasPrefix(src, "https://") { + d.ctxPaths[path.Join("/", filepath.ToSlash(src))] = struct{}{} + } } } case *instructions.LabelCommand: