mirror of
https://github.com/docker/cli.git
synced 2026-01-26 15:41:42 +03:00
move the `trust` subcommands to a plugin, so that the subcommands can
be installed separate from the `docker trust` integration in push/pull
(for situations where trust verification happens on the daemon side).
make binary
go build -o /usr/libexec/docker/cli-plugins/docker-trust ./cmd/docker-trust
docker info
Client:
Version: 28.2.0-dev
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.24.0
Path: /usr/libexec/docker/cli-plugins/docker-buildx
trust: Manage trust on Docker images (Docker Inc.)
Version: unknown-version
Path: /usr/libexec/docker/cli-plugins/docker-trust
docker trust --help
Usage: docker trust [OPTIONS] COMMAND
Extended build capabilities with BuildKit
Options:
-D, --debug Enable debug logging
Management Commands:
key Manage keys for signing Docker images
signer Manage entities who can sign Docker images
Commands:
inspect Return low-level information about keys and signatures
revoke Remove trust for an image
sign Sign an image
Run 'docker trust COMMAND --help' for more information on a command.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
33 lines
723 B
Go
33 lines
723 B
Go
package trust
|
|
|
|
import (
|
|
"github.com/docker/cli/cli"
|
|
"github.com/docker/cli/cli/command"
|
|
"github.com/docker/cli/internal/commands"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func init() {
|
|
commands.Register(newTrustCommand)
|
|
}
|
|
|
|
// newTrustCommand returns a cobra command for `trust` subcommands.
|
|
func newTrustCommand(dockerCLI command.Cli) *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "trust",
|
|
Short: "Manage trust on Docker images",
|
|
Args: cli.NoArgs,
|
|
RunE: command.ShowHelp(dockerCLI.Err()),
|
|
|
|
DisableFlagsInUseLine: true,
|
|
}
|
|
cmd.AddCommand(
|
|
newRevokeCommand(dockerCLI),
|
|
newSignCommand(dockerCLI),
|
|
newTrustKeyCommand(dockerCLI),
|
|
newTrustSignerCommand(dockerCLI),
|
|
newInspectCommand(dockerCLI),
|
|
)
|
|
return cmd
|
|
}
|