container_run_and_commit_layer 失败并显示:找不到 docker

发布于 2025-01-13 22:27:03 字数 517 浏览 1 评论 0原文

我在运行 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

水波映月 2025-01-20 22:27:03

该规则要求安装 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 to bazel clean --expunge after installing it to ensure the repository rule is evaluated again.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文