diff --git a/api/client/image/build.go b/api/client/image/build.go index e3d3f034fc..b1a227c099 100644 --- a/api/client/image/build.go +++ b/api/client/image/build.go @@ -421,7 +421,7 @@ func replaceDockerfileTarWrapper(ctx context.Context, inputTarStream io.ReadClos return } - var content io.Reader = tarReader + content := io.Reader(tarReader) if hdr.Name == dockerfileName { // This entry is the Dockerfile. Since the tar archive was // generated from a directory on the local filesystem, the diff --git a/api/server/router/build/build_routes.go b/api/server/router/build/build_routes.go index b5a7c28b69..7c95087be1 100644 --- a/api/server/router/build/build_routes.go +++ b/api/server/router/build/build_routes.go @@ -163,7 +163,7 @@ func (br *buildRouter) postBuild(ctx context.Context, w http.ResponseWriter, r * return progress.NewProgressReader(in, progressOutput, r.ContentLength, "Downloading context", remoteURL) } - var out io.Writer = output + out := io.Writer(output) if buildOptions.SuppressOutput { out = notVerboseBuffer }