1. docker buildx inspect

查看当前或指定一个明确的 builder 实例信息。

1.1. 帮助

# docker buildx inspect --help

Usage:  docker buildx inspect [NAME]

Inspect current builder instance

Options:
      --bootstrap        Ensure builder has booted before inspecting
      --builder string   Override the configured builder instance

1.2. 选项

Name Type Default Description
--bootstrap 查看 builder 信息前确保实例已经启动
--builder string 指定明确的 builder 实例,不操作默认的 builder

1.3. 示例

1.3.1. 查看 builder 信息前确保实例已经启动 (--bootstrap)

使用 --bootstrap 选项确认 builder 实例已经启动了才查看信息。如果是 docker-container 驱动,--bootstrap 选项会检查后端 builder 实例的是否在运行,没有运行就会启动这个实例,等待知道实例正常运行后再查看信息。

Bootstrapping is automatically done during build, and therefore not necessary. The same BuildKit container is used during the lifetime of the associated builder node (as displayed in buildx ls).

1.3.2. 查看一个 builder 实例的信息

默认情况下 inspect 会显示当前的 builder 信息,也可以通过 --builder 来指定一个明确的非默认实例。

下面的例子就是现实一个名为 elated_tesla 实例的信息:

$ docker buildx inspect elated_tesla

Name:   elated_tesla
Driver: docker-container

Nodes:
Name:      elated_tesla0
Endpoint:  unix:///var/run/docker.sock
Status:    running
Platforms: linux/amd64

Name:      elated_tesla1
Endpoint:  ssh://ubuntu@1.2.3.4
Status:    running
Platforms: linux/arm64, linux/arm/v7, linux/arm/v6

注意:不同的 buildx 版本再查看指定实例时可能需要指定 --builder 选项

2. 参考

Copyright © 温玉 2021 | 浙ICP备2020032454号 all right reserved,powered by Gitbook该文件修订时间: 2022-04-12 00:54:45

results matching ""

    No results matching ""