Windows: Fix long path handling for docker build

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
This commit is contained in:
Stefan J. Wernli 2015-08-24 14:07:22 -07:00
parent 5bebf3cbac
commit fe637416e9
9 changed files with 214 additions and 10 deletions

View file

@ -5,9 +5,9 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/docker/docker/pkg/archive"
"github.com/docker/docker/pkg/longpath"
)
// applyLayerHandler parses a diff in the standard layer format from `layer`, and
@ -17,9 +17,7 @@ func applyLayerHandler(dest string, layer archive.Reader, decompress bool) (size
dest = filepath.Clean(dest)
// Ensure it is a Windows-style volume path
if !strings.HasPrefix(dest, `\\?\`) {
dest = `\\?\` + dest
}
dest = longpath.AddPrefix(dest)
if decompress {
decompressed, err := archive.DecompressStream(layer)