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
14 changes: 14 additions & 0 deletions commands/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ import (
"time"

"github.com/docker/buildx/builder"
"github.com/docker/buildx/driver"
"github.com/docker/buildx/util/cobrautil/completion"
"github.com/docker/buildx/util/platformutil"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/debug"
"github.com/docker/go-units"
"github.com/moby/buildkit/util/appcontext"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -92,6 +94,18 @@ func runInspect(dockerCli command.Cli, in inspectOptions) error {
fmt.Fprintf(w, "Buildkit:\t%s\n", nodes[i].Version)
}
fmt.Fprintf(w, "Platforms:\t%s\n", strings.Join(platformutil.FormatInGroups(n.Node.Platforms, n.Platforms), ", "))
if debug.IsEnabled() {
fmt.Fprintf(w, "Features:\n")
features := nodes[i].Driver.Features(ctx)
featKeys := make([]string, 0, len(features))
for k := range features {
featKeys = append(featKeys, string(k))
}
sort.Strings(featKeys)
for _, k := range featKeys {
fmt.Fprintf(w, "\t%s:\t%t\n", k, features[driver.Feature(k)])
}
}
if len(nodes[i].Labels) > 0 {
fmt.Fprintf(w, "Labels:\n")
for _, k := range sortedKeys(nodes[i].Labels) {
Expand Down
6 changes: 6 additions & 0 deletions docs/reference/buildx_inspect.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,9 @@ GC Policy rule#3:
All: true
Keep Bytes: 24.21GiB
```

`debug` flag can also be used to get more information about the builder:

```console
$ docker --debug buildx inspect elated_tesla
```
6 changes: 3 additions & 3 deletions driver/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type Feature string
const OCIExporter Feature = "OCI exporter"
const DockerExporter Feature = "Docker exporter"

const CacheExport Feature = "cache export"
const MultiPlatform Feature = "multiple platforms"
const CacheExport Feature = "Cache export"
const MultiPlatform Feature = "Multiple platforms"

const HistoryAPI Feature = "history api"
const HistoryAPI Feature = "History API"