{"id":"9c4f13542d21fec9","repo":"docker/cli","slug":"docker-unknown-command-docker-s-run-docker-9c4f13","errorCode":null,"errorMessage":"docker: unknown command: docker %s\n\nRun 'docker --help' for more information","messagePattern":"docker: unknown command: docker (.+?)\n\nRun 'docker --help' for more information","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/docker/docker.go","lineNumber":152,"sourceCode":"}\n\nfunc newDockerCommand(dockerCli *command.DockerCli) *cli.TopLevelCommand {\n\tvar (\n\t\topts    *cliflags.ClientOptions\n\t\thelpCmd *cobra.Command\n\t)\n\n\tcmd := &cobra.Command{\n\t\tUse:              \"docker [OPTIONS] COMMAND [ARG...]\",\n\t\tShort:            \"A self-sufficient runtime for containers\",\n\t\tSilenceUsage:     true,\n\t\tSilenceErrors:    true,\n\t\tTraverseChildren: true,\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tif len(args) == 0 {\n\t\t\t\treturn command.ShowHelp(dockerCli.Err())(cmd, args)\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"docker: unknown command: docker %s\\n\\nRun 'docker --help' for more information\", args[0])\n\t\t},\n\t\tPersistentPreRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\treturn isSupported(cmd, dockerCli)\n\t\t},\n\t\tVersion:               fmt.Sprintf(\"%s, build %s\", version.Version, version.GitCommit),\n\t\tDisableFlagsInUseLine: true,\n\t\tCompletionOptions: cobra.CompletionOptions{\n\t\t\tDisableDefaultCmd:   false,\n\t\t\tHiddenDefaultCmd:    true,\n\t\t\tDisableDescriptions: os.Getenv(\"DOCKER_CLI_DISABLE_COMPLETION_DESCRIPTION\") != \"\",\n\t\t},\n\t}\n\n\t// Disable file-completion by default. Most commands and flags should not\n\t// complete with filenames.\n\tcmd.CompletionOptions.SetDefaultShellCompDirective(cobra.ShellCompDirectiveNoFileComp)\n\n\tcmd.SetIn(dockerCli.In())","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cmd/docker/docker.go#L134-L170","documentation":"Error \"docker: unknown command: docker %s\n\nRun 'docker --help' for more information\" thrown in docker/cli.","triggerScenarios":"Thrown at cmd/docker/docker.go:152 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}