MCPcopy
hub / github.com/moby/moby / Docker

Function Docker

integration-cli/cli/cli.go:96–110  ·  view source on GitHub ↗

Docker executes the specified docker command

(cmd icmd.Cmd, cmdOperators ...CmdOperator)

Source from the content-addressed store, hash-verified

94
95// Docker executes the specified docker command
96func Docker(cmd icmd.Cmd, cmdOperators ...CmdOperator) *icmd.Result {
97 for _, op := range cmdOperators {
98 deferFn := op(&cmd)
99 if deferFn != nil {
100 defer deferFn()
101 }
102 }
103 cmd.Command = append([]string{testEnv.DockerBinary()}, cmd.Command...)
104 if err := validateArgs(cmd.Command...); err != nil {
105 return &icmd.Result{
106 Error: err,
107 }
108 }
109 return icmd.RunCmd(cmd)
110}
111
112// validateArgs is a checker to ensure tests are not running commands which are
113// not supported on platforms. Specifically on Windows this is 'busybox top'.

Calls 3

validateArgsFunction · 0.85
DockerBinaryMethod · 0.80
RunCmdMethod · 0.80

Used in the wild real call sites across dependent graphs

searching dependent graphs…