mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #3641 from gfrey/fix_compression
detect compressed archives in API /build call
This commit is contained in:
commit
941d4ffa3e
1 changed files with 7 additions and 1 deletions
|
@ -630,7 +630,13 @@ func (b *buildFile) Build(context io.Reader) (string, error) {
|
|||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
b.context = &utils.TarSum{Reader: context, DisableCompression: true}
|
||||
|
||||
decompressedStream, err := archive.DecompressStream(context)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
b.context = &utils.TarSum{Reader: decompressedStream, DisableCompression: true}
|
||||
if err := archive.Untar(b.context, tmpdirPath, nil); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue