Skip to content

Commit a3335af

Browse files
committed
decorate --env-file, --label-file errors
Before: docker run --rm --env-file=./no-such-file alpine docker: open ./no-such-file: no such file or directory Run 'docker run --help' for more information After: docker run --rm --env-file=./no-such-file alpine docker: --env-file: open ./no-such-file: no such file or directory Run 'docker run --help' for more information Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent a6d013f commit a3335af

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cli/command/container/opts.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,13 +506,13 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
506506
// collect all the environment variables for the container
507507
envVariables, err := opts.ReadKVEnvStrings(copts.envFile.GetSlice(), copts.env.GetSlice())
508508
if err != nil {
509-
return nil, err
509+
return nil, fmt.Errorf("--env-file: %w", err)
510510
}
511511

512512
// collect all the labels for the container
513513
labels, err := opts.ReadKVStrings(copts.labelsFile.GetSlice(), copts.labels.GetSlice())
514514
if err != nil {
515-
return nil, err
515+
return nil, fmt.Errorf("--label-file: %w", err)
516516
}
517517

518518
pidMode := container.PidMode(copts.pidMode)

0 commit comments

Comments
 (0)