@@ -20,6 +20,7 @@ import (
2020 "github.com/docker/docker/pkg/streamformatter"
2121 "github.com/docker/docker/pkg/stringid"
2222 "github.com/moby/go-archive"
23+ "github.com/moby/go-archive/compression"
2324 "github.com/moby/patternmatcher"
2425 "github.com/pkg/errors"
2526)
@@ -163,7 +164,7 @@ func GetContextFromReader(rc io.ReadCloser, dockerfileName string) (out io.ReadC
163164 return nil , "" , err
164165 }
165166
166- tarArchive , err := archive .Tar (dockerfileDir , archive . Uncompressed )
167+ tarArchive , err := archive .Tar (dockerfileDir , compression . None )
167168 if err != nil {
168169 return nil , "" , err
169170 }
@@ -178,8 +179,7 @@ func GetContextFromReader(rc io.ReadCloser, dockerfileName string) (out io.ReadC
178179// IsArchive checks for the magic bytes of a tar or any supported compression
179180// algorithm.
180181func IsArchive (header []byte ) bool {
181- compression := archive .DetectCompression (header )
182- if compression != archive .Uncompressed {
182+ if compression .Detect (header ) != compression .None {
183183 return true
184184 }
185185 r := tar .NewReader (bytes .NewBuffer (header ))
@@ -427,7 +427,7 @@ func Compress(buildCtx io.ReadCloser) (io.ReadCloser, error) {
427427 pipeReader , pipeWriter := io .Pipe ()
428428
429429 go func () {
430- compressWriter , err := archive .CompressStream (pipeWriter , archive .Gzip )
430+ compressWriter , err := compression .CompressStream (pipeWriter , archive .Gzip )
431431 if err != nil {
432432 pipeWriter .CloseWithError (err )
433433 }
0 commit comments