mirror of https://github.com/docker/cli.git
build: error out if buildkit is on and stdin is used for both dockerfile and context
Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
parent
5314a8fc06
commit
89e102474c
|
@ -35,6 +35,8 @@ import (
|
|||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var errStdinConflict = errors.New("invalid argument: can't use stdin for both build context and dockerfile")
|
||||
|
||||
type buildOptions struct {
|
||||
context string
|
||||
dockerfileName string
|
||||
|
@ -192,7 +194,7 @@ func runBuild(dockerCli command.Cli, options buildOptions) error {
|
|||
|
||||
if options.dockerfileFromStdin() {
|
||||
if options.contextFromStdin() {
|
||||
return errors.New("invalid argument: can't use stdin for both build context and dockerfile")
|
||||
return errStdinConflict
|
||||
}
|
||||
dockerfileCtx = dockerCli.In()
|
||||
}
|
||||
|
|
|
@ -51,6 +51,9 @@ func runBuildBuildKit(dockerCli command.Cli, options buildOptions) error {
|
|||
)
|
||||
switch {
|
||||
case options.contextFromStdin():
|
||||
if options.dockerfileFromStdin() {
|
||||
return errStdinConflict
|
||||
}
|
||||
rc, isArchive, err := build.DetectArchiveReader(os.Stdin)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue