From d77e2453da366bfe413b3a3a34e2ca0437dbfef2 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Tue, 4 Jan 2022 22:01:08 -0800 Subject: [PATCH] commands: rename context flag to build-context Avoid conflicts with docker context Signed-off-by: Tonis Tiigi --- build/build.go | 4 ++-- commands/build.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/build.go b/build/build.go index d0b77b0a..0b83999b 100644 --- a/build/build.go +++ b/build/build.go @@ -1090,10 +1090,10 @@ func LoadInputs(ctx context.Context, d driver.Driver, inp Inputs, pw progress.Wr } st, err := os.Stat(v) if err != nil { - return nil, errors.Wrapf(err, "failed to get context %v", k) + return nil, errors.Wrapf(err, "failed to get build context %v", k) } if !st.IsDir() { - return nil, errors.Wrapf(syscall.ENOTDIR, "failed to get context path %v", v) + return nil, errors.Wrapf(syscall.ENOTDIR, "failed to get build context path %v", v) } localName := k if k == "context" || k == "dockerfile" { diff --git a/commands/build.go b/commands/build.go index 96df9202..fdfc1b39 100644 --- a/commands/build.go +++ b/commands/build.go @@ -347,7 +347,7 @@ func buildCmd(dockerCli command.Cli, rootOpts *rootOptions) *cobra.Command { flags.StringVar(&options.cgroupParent, "cgroup-parent", "", "Optional parent cgroup for the container") flags.SetAnnotation("cgroup-parent", annotation.ExternalURL, []string{"https://docs.docker.com/engine/reference/commandline/build/#use-a-custom-parent-cgroup---cgroup-parent"}) - flags.StringArrayVar(&options.contexts, "context", []string{}, "Additional named contexts (e.g., name=path)") + flags.StringArrayVar(&options.contexts, "build-context", []string{}, "Additional build contexts (e.g., name=path)") flags.StringVarP(&options.dockerfileName, "file", "f", "", `Name of the Dockerfile (default: "PATH/Dockerfile")`) flags.SetAnnotation("file", annotation.ExternalURL, []string{"https://docs.docker.com/engine/reference/commandline/build/#specify-a-dockerfile--f"})