docker/cli ยท error

error reading content from %q: %v

Error message

error reading content from %q: %v

What it means

Error "error reading content from %q: %v" thrown in docker/cli.

Source

Thrown at cli/command/config/create.go:73

			}
		},
		DisableFlagsInUseLine: true,
	}
	flags := cmd.Flags()
	flags.VarP(&createOpts.labels, "label", "l", "Config labels")
	flags.StringVar(&createOpts.templateDriver, "template-driver", "", "Template driver")
	_ = flags.SetAnnotation("template-driver", "version", []string{"1.37"})

	return cmd
}

// runCreate creates a config with the given options.
func runCreate(ctx context.Context, dockerCLI command.Cli, options createOptions) error {
	apiClient := dockerCLI.Client()

	configData, err := readConfigData(dockerCLI.In(), options.file)
	if err != nil {
		return fmt.Errorf("error reading content from %q: %v", options.file, err)
	}

	spec := swarm.ConfigSpec{
		Annotations: swarm.Annotations{
			Name:   options.name,
			Labels: opts.ConvertKVStringsToMap(options.labels.GetSlice()),
		},
		Data: configData,
	}
	if options.templateDriver != "" {
		spec.Templating = &swarm.Driver{
			Name: options.templateDriver,
		}
	}
	r, err := apiClient.ConfigCreate(ctx, client.ConfigCreateOptions{
		Spec: spec,
	})
	if err != nil {

View on GitHub (pinned to e9452d6e78)

When it happens

Trigger: Thrown at cli/command/config/create.go:73 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of docker/cli@e9452d6e78 (2026-08-01). Data as JSON: /data/errors/4f3810529093bf8c.json. Report an issue: GitHub.