diff --git a/command/image/pull.go b/command/image/pull.go index 515273d43c..7152fdc526 100644 --- a/command/image/pull.go +++ b/command/image/pull.go @@ -76,7 +76,7 @@ func runPull(dockerCli *command.DockerCli, opts pullOptions) error { err = imagePullPrivileged(ctx, dockerCli, authConfig, reference.FamiliarString(distributionRef), requestPrivilege, opts.all) } if err != nil { - if strings.Contains(err.Error(), "target is plugin") { + if strings.Contains(err.Error(), "when fetching 'plugin'") { return errors.New(err.Error() + " - Use `docker plugin install`") } return err diff --git a/command/plugin/install.go b/command/plugin/install.go index 9e9ea40e2a..ed874e17b9 100644 --- a/command/plugin/install.go +++ b/command/plugin/install.go @@ -144,7 +144,7 @@ func runInstall(dockerCli *command.DockerCli, opts pluginOptions) error { } responseBody, err := dockerCli.Client().PluginInstall(ctx, localName, options) if err != nil { - if strings.Contains(err.Error(), "target is image") { + if strings.Contains(err.Error(), "(image) when fetching") { return errors.New(err.Error() + " - Use `docker image pull`") } return err