diff --git a/cli/command/image/build.go b/cli/command/image/build.go index 6c6db76675..15448e7b49 100644 --- a/cli/command/image/build.go +++ b/cli/command/image/build.go @@ -145,7 +145,7 @@ func NewBuildCommand(dockerCli command.Cli) *cobra.Command { flags.SetAnnotation("target", annotation.ExternalURL, []string{"https://docs.docker.com/reference/cli/docker/buildx/build/#target"}) flags.StringVar(&options.imageIDFile, "iidfile", "", "Write the image ID to the file") - command.AddTrustVerificationFlags(flags, &options.untrusted, dockerCli.ContentTrustEnabled()) + flags.BoolVar(&options.untrusted, "disable-content-trust", !dockerCli.ContentTrustEnabled(), "Skip image verification") flags.StringVar(&options.platform, "platform", os.Getenv("DOCKER_DEFAULT_PLATFORM"), "Set platform if server is multi-platform capable") flags.SetAnnotation("platform", "version", []string{"1.38"}) diff --git a/cli/command/plugin/install.go b/cli/command/plugin/install.go index 33a7179edd..31f123ddfe 100644 --- a/cli/command/plugin/install.go +++ b/cli/command/plugin/install.go @@ -31,7 +31,7 @@ type pluginOptions struct { func loadPullFlags(dockerCli command.Cli, opts *pluginOptions, flags *pflag.FlagSet) { flags.BoolVar(&opts.grantPerms, "grant-all-permissions", false, "Grant all permissions necessary to run the plugin") - command.AddTrustVerificationFlags(flags, &opts.untrusted, dockerCli.ContentTrustEnabled()) + flags.BoolVar(&opts.untrusted, "disable-content-trust", !dockerCli.ContentTrustEnabled(), "Skip image verification") } func newInstallCommand(dockerCli command.Cli) *cobra.Command { diff --git a/cli/command/plugin/push.go b/cli/command/plugin/push.go index 573ae3d0ae..f70e36910c 100644 --- a/cli/command/plugin/push.go +++ b/cli/command/plugin/push.go @@ -33,7 +33,7 @@ func newPushCommand(dockerCli command.Cli) *cobra.Command { flags := cmd.Flags() - command.AddTrustSigningFlags(flags, &opts.untrusted, dockerCli.ContentTrustEnabled()) + flags.BoolVar(&opts.untrusted, "disable-content-trust", !dockerCli.ContentTrustEnabled(), "Skip image signing") return cmd }