Merge pull request #4073 from crosbymichael/fix-docker-cp-close
Ensure docker cp stream is closed properly
This commit is contained in:
commit
c6edac9a1a
|
@ -1427,7 +1427,7 @@ func (container *Container) GetSize() (int64, int64) {
|
|||
return sizeRw, sizeRootfs
|
||||
}
|
||||
|
||||
func (container *Container) Copy(resource string) (archive.Archive, error) {
|
||||
func (container *Container) Copy(resource string) (io.ReadCloser, error) {
|
||||
if err := container.Mount(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -1454,7 +1454,7 @@ func (container *Container) Copy(resource string) (archive.Archive, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return EofReader(archive, func() { container.Unmount() }), nil
|
||||
return utils.NewReadCloserWrapper(archive, container.Unmount), nil
|
||||
}
|
||||
|
||||
// Returns true if the container exposes a certain port
|
||||
|
|
Loading…
Reference in New Issue