Skip to content
Open
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
3 changes: 3 additions & 0 deletions api/client/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,9 @@ func (cli *DockerCli) CmdInfo(args ...string) error {
if remoteInfo.Exists("Images") {
fmt.Fprintf(cli.out, "Images: %d\n", remoteInfo.GetInt("Images"))
}
if remoteInfo.Exists("Plugins") {
fmt.Fprintf(cli.out, "Plugins: %d\n", remoteInfo.GetInt("Plugins"))
}
if remoteInfo.Exists("Driver") {
fmt.Fprintf(cli.out, "Storage Driver: %s\n", remoteInfo.Get("Driver"))
}
Expand Down
2 changes: 2 additions & 0 deletions daemon/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/docker/docker/pkg/parsers/kernel"
"github.com/docker/docker/pkg/parsers/operatingsystem"
"github.com/docker/docker/pkg/system"
"github.com/docker/docker/plugins"
"github.com/docker/docker/registry"
"github.com/docker/docker/utils"
)
Expand Down Expand Up @@ -67,6 +68,7 @@ func (daemon *Daemon) CmdInfo(job *engine.Job) engine.Status {
v := &engine.Env{}
v.SetJson("ID", daemon.ID)
v.SetInt("Containers", len(daemon.List()))
v.SetInt("Plugins", plugins.Repo.CountPlugins())
v.SetInt("Images", imgcount)
v.Set("Driver", daemon.GraphDriver().String())
v.SetJson("DriverStatus", daemon.GraphDriver().Status())
Expand Down
6 changes: 6 additions & 0 deletions plugins/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ func NewRepository() *Repository {
}
}

func (repository *Repository) CountPlugins() int {
// TODO: expand this to include other supported types
plugins, _ := repository.GetPlugins("volume")
return len(plugins)
}

func (repository *Repository) RegisterPlugin(addr string) error {
plugin := &Plugin{addr: addr}
resp, err := plugin.handshake()
Expand Down