Skip to content

Commit 7b37f30

Browse files
dmcgowanthaJeztah
authored andcommitted
Use io.copy for build context compression
The use of pools here is unnecessary and creates a code dependency on moby library which will move to internal. The pool does not provide any value here since it is only done for a single operation and unlikely performed in alongside other operations which are re-using the buffers many times between garbage collections. Signed-off-by: Derek McGowan <derek@mcg.dev> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 7138107 commit 7b37f30

3 files changed

Lines changed: 1 addition & 140 deletions

File tree

cli/command/image/build/context.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"github.com/docker/docker/builder/remotecontext/git"
1818
"github.com/docker/docker/pkg/archive"
1919
"github.com/docker/docker/pkg/ioutils"
20-
"github.com/docker/docker/pkg/pools"
2120
"github.com/docker/docker/pkg/progress"
2221
"github.com/docker/docker/pkg/streamformatter"
2322
"github.com/docker/docker/pkg/stringid"
@@ -434,7 +433,7 @@ func Compress(buildCtx io.ReadCloser) (io.ReadCloser, error) {
434433
}
435434
defer buildCtx.Close()
436435

437-
if _, err := pools.Copy(compressWriter, buildCtx); err != nil {
436+
if _, err := io.Copy(compressWriter, buildCtx); err != nil {
438437
pipeWriter.CloseWithError(errors.Wrap(err, "failed to compress context"))
439438
compressWriter.Close()
440439
return

vendor/github.com/docker/docker/pkg/pools/pools.go

Lines changed: 0 additions & 137 deletions
This file was deleted.

vendor/modules.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ github.com/docker/docker/pkg/idtools
8888
github.com/docker/docker/pkg/ioutils
8989
github.com/docker/docker/pkg/jsonmessage
9090
github.com/docker/docker/pkg/longpath
91-
github.com/docker/docker/pkg/pools
9291
github.com/docker/docker/pkg/process
9392
github.com/docker/docker/pkg/progress
9493
github.com/docker/docker/pkg/stdcopy

0 commit comments

Comments
 (0)