Skip to content

Commit

Permalink
Discard read bytes to not waste RAM
Browse files Browse the repository at this point in the history
  • Loading branch information
ash2k committed Jun 27, 2024
1 parent f10cf48 commit 9d6ff02
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package testcontainers
import (
"archive/tar"
"bufio"
"bytes"
"context"
"encoding/base64"
"encoding/binary"
Expand Down Expand Up @@ -928,8 +927,7 @@ func (p *DockerProvider) BuildImage(ctx context.Context, img ImageBuildInfo) (st

// need to read the response from Docker, I think otherwise the image
// might not finish building before continuing to execute here
buf := new(bytes.Buffer)
_, err = buf.ReadFrom(resp.Body)
_, err = io.Copy(io.Discard, resp.Body)
if err != nil {
return "", err
}
Expand Down

0 comments on commit 9d6ff02

Please sign in to comment.