diff --git a/builder/dockerfile/clientsession.go b/builder/dockerfile/clientsession.go index 9a5411685a347fc0144f50f7fc1a70f148930dce..2ef5bf5462e36953803631aff88923d59035af9f 100644 --- a/builder/dockerfile/clientsession.go +++ b/builder/dockerfile/clientsession.go @@ -41,7 +41,6 @@ func (cst *ClientSessionTransport) Copy(ctx context.Context, id fscache.RemoteId type ClientSessionSourceIdentifier struct { includePatterns []string caller session.Caller - sharedKey string uuid string } diff --git a/builder/dockerfile/copy_windows.go b/builder/dockerfile/copy_windows.go index dcf4c5acfb87ca2e18304b80ec3460bebf63605c..f7fc6e0329acca8367a8f1dca62badf4f41c4da6 100644 --- a/builder/dockerfile/copy_windows.go +++ b/builder/dockerfile/copy_windows.go @@ -8,6 +8,11 @@ import ( "github.com/docker/docker/pkg/idtools" ) +var pathBlacklist = map[string]bool{ + "c:\\": true, + "c:\\windows": true, +} + func fixPermissions(source, destination string, rootIDs idtools.IDPair, overrideSkip bool) error { // chown is not supported on Windows return nil diff --git a/builder/dockerfile/evaluator.go b/builder/dockerfile/evaluator.go index cd4f513fad108d048d5f59ac518dfae8c217944c..40af56604b15c209c446818d83d13b3f07975403 100644 --- a/builder/dockerfile/evaluator.go +++ b/builder/dockerfile/evaluator.go @@ -203,13 +203,6 @@ func (s *dispatchState) hasFromImage() bool { return s.imageID != "" || (s.baseImage != nil && s.baseImage.ImageID() == "") } -func (s *dispatchState) isCurrentStage(target string) bool { - if target == "" { - return false - } - return strings.EqualFold(s.stageName, target) -} - func (s *dispatchState) beginStage(stageName string, image builder.Image) { s.stageName = stageName s.imageID = image.ImageID() diff --git a/builder/dockerfile/imagecontext.go b/builder/dockerfile/imagecontext.go index 084255d173efb4d1e18138fb78648242be64ecf4..2301d1aab458e0b399af7d127b4ef2bc9aeeb1cf 100644 --- a/builder/dockerfile/imagecontext.go +++ b/builder/dockerfile/imagecontext.go @@ -18,7 +18,6 @@ type imageSources struct { byImageID map[string]*imageMount mounts []*imageMount getImage getAndMountFunc - cache pathCache // TODO: remove } // TODO @jhowardmsft LCOW Support: Eventually, platform can be moved to options.Options.Platform, diff --git a/builder/dockerfile/internals.go b/builder/dockerfile/internals.go index 4c82e61588952d72bc56582aa878c11957bde6e2..be46d3186dc0e3c42b2d0fba5e8976d8b88db8d2 100644 --- a/builder/dockerfile/internals.go +++ b/builder/dockerfile/internals.go @@ -29,12 +29,6 @@ import ( "github.com/pkg/errors" ) -// For Windows only -var pathBlacklist = map[string]bool{ - "c:\\": true, - "c:\\windows": true, -} - // Archiver defines an interface for copying files from one destination to // another using Tar/Untar. type Archiver interface { diff --git a/builder/fscache/fscache.go b/builder/fscache/fscache.go index 880cc9d10d9166a12bc79b05de12f9be8632422c..7cb4c5cbe95bf67c338f7f86a03280e51e72484b 100644 --- a/builder/fscache/fscache.go +++ b/builder/fscache/fscache.go @@ -217,7 +217,6 @@ func syncFrom(ctx context.Context, cs *cachedSourceRef, transport Transport, id } type fsCacheStore struct { - root string mu sync.Mutex sources map[string]*cachedSource db *bolt.DB diff --git a/builder/remotecontext/tarsum.go b/builder/remotecontext/tarsum.go index 370f13d80b6e9a978efb8e20266bccdede2f39be..78f7470b37f2140deb001c4844e8beac9763dbfb 100644 --- a/builder/remotecontext/tarsum.go +++ b/builder/remotecontext/tarsum.go @@ -1,7 +1,6 @@ package remotecontext import ( - "fmt" "os" "sync" @@ -133,19 +132,6 @@ func (cs *CachableSource) Close() error { return nil } -func (cs *CachableSource) normalize(path string) (cleanpath, fullpath string, err error) { - cleanpath = cs.root.Clean(string(cs.root.Separator()) + path)[1:] - fullpath, err = cs.root.ResolveScopedPath(path, true) - if err != nil { - return "", "", fmt.Errorf("Forbidden path outside the context: %s (%s)", path, fullpath) - } - _, err = cs.root.Lstat(fullpath) - if err != nil { - return "", "", convertPathError(err, path) - } - return -} - // Hash returns a hash for a single file in the source func (cs *CachableSource) Hash(path string) (string, error) { n := cs.getRoot()