From 5ecff53e0c481a4fc693740c324da5b079641654 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Tue, 3 Sep 2024 08:54:42 -0700 Subject: [PATCH] bake: read original command name from the env for prompt Signed-off-by: Tonis Tiigi --- bake/entitlements.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bake/entitlements.go b/bake/entitlements.go index 24add703..030e812b 100644 --- a/bake/entitlements.go +++ b/bake/entitlements.go @@ -6,7 +6,6 @@ import ( "fmt" "io" "os" - "path/filepath" "slices" "strings" @@ -143,8 +142,8 @@ func (c EntitlementConf) Prompt(ctx context.Context, out io.Writer) error { } args := append([]string(nil), os.Args...) - if filepath.Base(args[0]) == "docker-buildx" { - args[0] = "docker" + if v, ok := os.LookupEnv("DOCKER_CLI_PLUGIN_ORIGINAL_CLI_COMMAND"); ok && v != "" { + args[0] = v } idx := slices.Index(args, "bake")