DockerCLI/cli/command/image
Sebastiaan van Stijn c2535aa467
build: error if Dockerfile name is passed with Dockerfile from stdin
When passing a Dockerfile through stdin, it's not possible to specify the
name of the Dockerfile (using the `-f` option). When building with BuildKit
enabled, an error is already produced for this case, but the classic builder
silently ignored it.

This patch adds an error for this situation:

    echo -e 'FROM busybox' | DOCKER_BUILDKIT=0 docker build -f some.Dockerfile -
    DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
    BuildKit is currently disabled; enable it by removing the DOCKER_BUILDKIT=0
    environment-variable.

    unable to prepare context: ambiguous Dockerfile source: both stdin and flag correspond to Dockerfiles

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-06-13 14:03:03 +02:00
..
build build: error if Dockerfile name is passed with Dockerfile from stdin 2023-06-13 14:03:03 +02:00
testdata vendor: github.com/docker/docker v24.0.0-rc.1 2023-04-28 17:56:17 +02:00
build.go cli/command/image: remove errStdinConflict 2023-06-13 13:47:56 +02:00
build_test.go test/e2e: Use "frozen" tag to reference test images 2023-04-27 10:57:57 +02:00
client_test.go cli/command/image: fakeClient: remove name for unused arg (revive) 2023-03-30 17:22:06 +02:00
cmd.go Adopt Cobra completion v2 to support completion by CLI plugins 2022-05-12 12:59:10 +02:00
formatter_history.go cli: use N/A as placeholder for old CREATED dates 2022-09-19 12:08:10 -04:00
formatter_history_test.go format code with gofumpt 2022-09-30 11:59:11 +02:00
history.go cli: use custom annotation for aliases 2022-06-28 17:32:09 +02:00
history_test.go cli/command/image: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:41:55 +01:00
import.go cli: use custom annotation for aliases 2022-06-28 17:32:09 +02:00
import_test.go cli/command/image: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:41:55 +01:00
inspect.go Output compact JSON by default for --format=json 2022-03-15 15:42:35 +01:00
inspect_test.go vendor: github.com/docker/docker v20.10.3-0.20220309172631-83b51522df43 2022-03-09 18:45:37 +01:00
list.go cli: use custom annotation for aliases 2022-06-28 17:32:09 +02:00
list_test.go test/cli: Use empty array as empty output of images/json 2023-02-24 15:05:32 +01:00
load.go format code with gofumpt 2022-09-30 11:59:11 +02:00
load_test.go cli/command/image: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:41:55 +01:00
prune.go cmd: set double quotes as code delimiter 2023-01-06 19:15:33 +01:00
prune_test.go cli/command/image: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:41:55 +01:00
pull.go cli/trust: remove special handling for "plugin" Class 2023-03-23 13:44:48 +01:00
pull_test.go cli/command/image: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:41:55 +01:00
push.go cli/command: replace EncodeAuthToBase64 for registry.EncodeAuthConfig 2023-04-12 21:17:15 +02:00
push_test.go cli/command/image: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:41:55 +01:00
remove.go replace uses of client.IsErrNotFound for errdefs.IsNotFound 2023-05-11 23:09:29 +02:00
remove_test.go cli/command: don't use legacy "notfound" error-type in tests 2023-05-11 23:09:12 +02:00
save.go cli: use custom annotation for aliases 2022-06-28 17:32:09 +02:00
save_test.go cli/command/image: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:41:55 +01:00
tag.go cli: use custom annotation for aliases 2022-06-28 17:32:09 +02:00
tag_test.go cli/command/image: remove deprecated io/ioutil and use t.TempDir() 2022-02-25 15:41:55 +01:00
trust.go cli/command/image: imagePullPrivileged: remove intermediate variables 2023-04-12 21:17:15 +02:00
trust_test.go replace uses of deprecated env.Patch() 2022-09-22 17:28:07 +02:00