docker buildx rm
| 描述 | 移除一个或多个构建器实例 |
|---|---|
| 用法 | docker buildx rm [选项] [名称...] |
描述
移除指定的或当前构建器。尝试移除默认构建器是无效操作。
选项
| 选项 | 默认值 | 描述 |
|---|---|---|
--all-inactive | 移除所有非活动构建器 | |
-f, --force | 不提示确认 | |
--keep-daemon | 保持 BuildKit 守护进程运行 | |
--keep-state | 保持 BuildKit 状态 |
示例
移除所有非活动构建器 (--all-inactive)
移除非运行状态的构建器。
$ docker buildx rm --all-inactive
WARNING! This will remove all builders that are not in running state. Are you sure you want to continue? [y/N] y
覆盖已配置的构建器实例(--builder)
不提示确认 (--force)
在移除非活动构建器之前不提示确认。
$ docker buildx rm --all-inactive --force
保持 BuildKit 守护进程运行 (--keep-daemon)
在 buildx 上下文被移除后,保持 BuildKit 守护进程运行。这在你独立管理 BuildKit 守护进程和 buildx 上下文时很有用。仅由 docker-container 和 kubernetes 驱动程序支持。
保持 BuildKit 状态 (--keep-state)
保持 BuildKit 状态,以便新的同名构建器可以重用它。目前,仅由 docker-container 驱动程序支持。