mirror of https://github.com/docker/cli.git
cli/command/image/build: GetContextFromReader: rename var that collided
This var collided with the `archive/tar` import. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
ab17029c63
commit
2b7bfb3994
|
@ -161,13 +161,13 @@ func GetContextFromReader(rc io.ReadCloser, dockerfileName string) (out io.ReadC
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
tar, err := archive.Tar(dockerfileDir, archive.Uncompressed)
|
tarArchive, err := archive.Tar(dockerfileDir, archive.Uncompressed)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
return ioutils.NewReadCloserWrapper(tar, func() error {
|
return ioutils.NewReadCloserWrapper(tarArchive, func() error {
|
||||||
err := tar.Close()
|
err := tarArchive.Close()
|
||||||
os.RemoveAll(dockerfileDir)
|
os.RemoveAll(dockerfileDir)
|
||||||
return err
|
return err
|
||||||
}), DefaultDockerfileName, nil
|
}), DefaultDockerfileName, nil
|
||||||
|
@ -432,8 +432,7 @@ func Compress(buildCtx io.ReadCloser) (io.ReadCloser, error) {
|
||||||
defer buildCtx.Close()
|
defer buildCtx.Close()
|
||||||
|
|
||||||
if _, err := pools.Copy(compressWriter, buildCtx); err != nil {
|
if _, err := pools.Copy(compressWriter, buildCtx); err != nil {
|
||||||
pipeWriter.CloseWithError(
|
pipeWriter.CloseWithError(errors.Wrap(err, "failed to compress context"))
|
||||||
errors.Wrap(err, "failed to compress context"))
|
|
||||||
compressWriter.Close()
|
compressWriter.Close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue