container_run_and_commit_layer 失败并显示:找不到 docker
我在运行 container_run_and_commit_layer
时遇到问题,收到的错误消息
docker not found; do you need to manually configure the docker toolchain?
来自我所看到的,这与未设置 DOCKER
变量相关:
# Resolve the docker tool path
DOCKER=""
DOCKER_FLAGS=""
if [[ -z "$DOCKER" ]]; then
echo >&2 "error: docker not found; do you need to manually configure the docker toolchain?"
exit 1
fi
我正在调用 container_repositories( )
在我的工作区文件中,我是否遗漏了某些内容?
I have a problem when running container_run_and_commit_layer
, the error message I get is
docker not found; do you need to manually configure the docker toolchain?
from what I see this is related to DOCKER
variable not set:
# Resolve the docker tool path
DOCKER=""
DOCKER_FLAGS=""
if [[ -z "$DOCKER" ]]; then
echo >&2 "error: docker not found; do you need to manually configure the docker toolchain?"
exit 1
fi
I'm calling container_repositories()
in my workspace file, am I missing something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该规则要求安装 Docker。默认情况下,它期望通过
$PATH
找到docker
。如果没有,您就会收到该错误。rules_docker 文档的设置部分列出了所有可选工具,并展示了如何设置自定义路径给他们。一些rules_docker规则不需要任何这些,所以它们可以正常工作。在未安装给定工具的情况下运行时,确实需要这些工具的规则会出现类似的错误。
如果您现在安装 docker,则可能需要在安装后执行 bazel clean --expunge 以确保再次评估存储库规则。
That rule requires Docker to be installed. By default, it expects to find
docker
via$PATH
. When it doesn't, you get that error.The Setup section of the rules_docker documentation lists all the optional tools, and shows how to set custom paths to them. Some of the rules_docker rules don't need any of those, so they'll work fine. The rules which do need those tools give errors like this when run when the given tools aren't installed.
If you install
docker
now, you might have tobazel clean --expunge
after installing it to ensure the repository rule is evaluated again.