Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions cli/command/image/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"io"
"os"
"path/filepath"
"runtime"
"strings"

"github.com/distribution/reference"
Expand Down Expand Up @@ -385,16 +384,6 @@ func runBuild(ctx context.Context, dockerCli command.Cli, options buildOptions)
return err
}

// Windows: show error message about modified file permissions if the
// daemon isn't running Windows.
if response.OSType != "windows" && runtime.GOOS == "windows" && !options.quiet {
_, _ = fmt.Fprintln(dockerCli.Out(), "SECURITY WARNING: You are building a Docker "+
"image from Windows against a non-Windows Docker host. All files and "+
"directories added to build context will have '-rwxr-xr-x' permissions. "+
"It is recommended to double check and reset permissions for sensitive "+
"files and directories.")
}

// Everything worked so if -q was provided the output from the daemon
// should be just the image ID and we'll print that to stdout.
if options.quiet {
Expand Down
15 changes: 6 additions & 9 deletions cli/command/image/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ package image

import (
"context"
"errors"
"fmt"
"strings"

"github.com/distribution/reference"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/command/completion"
"github.com/docker/cli/cli/trust"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -87,15 +86,13 @@ func runPull(ctx context.Context, dockerCLI command.Cli, opts pullOptions) error
// Check if reference has a digest
_, isCanonical := distributionRef.(reference.Canonical)
if !opts.untrusted && !isCanonical {
err = trustedPull(ctx, dockerCLI, imgRefAndAuth, opts)
if err := trustedPull(ctx, dockerCLI, imgRefAndAuth, opts); err != nil {
return err
}
} else {
err = imagePullPrivileged(ctx, dockerCLI, imgRefAndAuth, opts)
}
if err != nil {
if strings.Contains(err.Error(), "when fetching 'plugin'") {
return errors.New(err.Error() + " - Use `docker plugin install`")
if err := imagePullPrivileged(ctx, dockerCLI, imgRefAndAuth, opts); err != nil {
return err
}
return err
}
_, _ = fmt.Fprintln(dockerCLI.Out(), imgRefAndAuth.Reference().String())
return nil
Expand Down
4 changes: 0 additions & 4 deletions cli/command/plugin/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package plugin
import (
"context"
"fmt"
"strings"

"github.com/distribution/reference"
"github.com/docker/cli/cli"
Expand Down Expand Up @@ -120,9 +119,6 @@ func runInstall(ctx context.Context, dockerCLI command.Cli, opts pluginOptions)
}
responseBody, err := dockerCLI.Client().PluginInstall(ctx, localName, options)
if err != nil {
if strings.Contains(err.Error(), "(image) when fetching") {
return errors.New(err.Error() + " - Use \"docker image pull\"")
}
return err
}
defer func() {
Expand Down
8 changes: 0 additions & 8 deletions cli/command/plugin/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ func TestInstallErrors(t *testing.T) {
return nil, errors.New("error installing plugin")
},
},
{
description: "installation error due to missing image",
args: []string{"foo"},
expectedError: "docker image pull",
installFunc: func(name string, options types.PluginInstallOptions) (io.ReadCloser, error) {
return nil, errors.New("(image) when fetching")
},
},
}

for _, tc := range testCases {
Expand Down
4 changes: 0 additions & 4 deletions cli/command/plugin/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package plugin
import (
"context"
"fmt"
"strings"

"github.com/distribution/reference"
"github.com/docker/cli/cli"
Expand Down Expand Up @@ -80,9 +79,6 @@ func runUpgrade(ctx context.Context, dockerCLI command.Cli, opts pluginOptions)

responseBody, err := dockerCLI.Client().PluginUpgrade(ctx, opts.localName, options)
if err != nil {
if strings.Contains(err.Error(), "target is image") {
return errors.New(err.Error() + " - Use `docker image pull`")
}
return err
}
defer func() {
Expand Down