build: use correct in-memory input

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
pull/152/head
Tonis Tiigi 5 years ago
parent 7c97854b6f
commit 75f8d7ebb5

@ -735,7 +735,7 @@ func LoadInputs(inp Inputs, target *client.SolveOpt) (func(), error) {
return nil, errStdinConflict return nil, errStdinConflict
} }
buf := bufio.NewReader(os.Stdin) buf := bufio.NewReader(inp.InStream)
magic, err := buf.Peek(archiveHeaderSize * 2) magic, err := buf.Peek(archiveHeaderSize * 2)
if err != nil && err != io.EOF { if err != nil && err != io.EOF {
return nil, errors.Wrap(err, "failed to peek context header from STDIN") return nil, errors.Wrap(err, "failed to peek context header from STDIN")
@ -761,7 +761,7 @@ func LoadInputs(inp Inputs, target *client.SolveOpt) (func(), error) {
target.LocalDirs["context"] = inp.ContextPath target.LocalDirs["context"] = inp.ContextPath
switch inp.DockerfilePath { switch inp.DockerfilePath {
case "-": case "-":
dockerfileReader = os.Stdin dockerfileReader = inp.InStream
case "": case "":
dockerfileDir = inp.ContextPath dockerfileDir = inp.ContextPath
default: default:

Loading…
Cancel
Save