From 0de4e6e9a7b5ebc869abb28718bfae58ef9b83c9 Mon Sep 17 00:00:00 2001 From: Alexey Igrychev Date: Mon, 14 Dec 2020 13:35:08 +0000 Subject: [PATCH] Fix reading context and dockerfile from stdin with BuildKit Signed-off-by: Alexey Igrychev (cherry picked from commit fc9ca9a94aa7fc00690e0e5c10671a63a1bf2fa5) Signed-off-by: Sebastiaan van Stijn --- cli/command/image/build_buildkit.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/command/image/build_buildkit.go b/cli/command/image/build_buildkit.go index e377fc2886..b40d53cdbd 100644 --- a/cli/command/image/build_buildkit.go +++ b/cli/command/image/build_buildkit.go @@ -78,7 +78,7 @@ func runBuildBuildKit(dockerCli command.Cli, options buildOptions) error { if options.dockerfileFromStdin() { return errStdinConflict } - rc, isArchive, err := build.DetectArchiveReader(os.Stdin) + rc, isArchive, err := build.DetectArchiveReader(dockerCli.In()) if err != nil { return err } @@ -98,7 +98,7 @@ func runBuildBuildKit(dockerCli command.Cli, options buildOptions) error { case isLocalDir(options.context): contextDir = options.context if options.dockerfileFromStdin() { - dockerfileReader = os.Stdin + dockerfileReader = dockerCli.In() } else if options.dockerfileName != "" { dockerfileName = filepath.Base(options.dockerfileName) dockerfileDir = filepath.Dir(options.dockerfileName)