MCPcopy Create free account
hub / github.com/docker/cli / newSignCommand

Function newSignCommand

cmd/docker-trust/trust/sign.go:28–43  ·  view source on GitHub ↗
(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

26}
27
28func newSignCommand(dockerCLI command.Cli) *cobra.Command {
29 options := signOptions{}
30 cmd := &cobra.Command{
31 Use: "sign IMAGE:TAG",
32 Short: "Sign an image",
33 Args: cli.ExactArgs(1),
34 RunE: func(cmd *cobra.Command, args []string) error {
35 options.imageName = args[0]
36 return runSignImage(cmd.Context(), dockerCLI, options)
37 },
38 DisableFlagsInUseLine: true,
39 }
40 flags := cmd.Flags()
41 flags.BoolVar(&options.local, "local", false, "Sign a locally tagged image")
42 return cmd
43}
44
45func runSignImage(ctx context.Context, dockerCLI command.Cli, options signOptions) error {
46 imageName := options.imageName

Callers 6

NewRootCmdFunction · 0.85
newTrustCommandFunction · 0.85
TestSignCommandLocalFlagFunction · 0.85

Calls 1

runSignImageFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…