alibaba / alibaba/havenask

创建容器命令挂载了宿主机$HOME 文件夹导致编译失败

Open
#278 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.8k
Forks
352
PR merge metrics
No merged PRs in 30d

Description

[https://github.com/alibaba/havenask/blob/main/docker/havenask/create_container.sh#L71](https://github.com/alibaba/havenask/blob/main/docker/havenask/create_container.sh#L71)
这里在创建容器时会挂载宿主机$HOME 文件夹到容器内,`-v $HOME:$HOME` , 这样宿主机的很多配置文件和缓存可能会污染容器,导致预期外的行为。

我在尝试编译的时候就遇到了这个问题:

Image

`clang-8-with-gcc-8-toolchain` 应该是我宿主机的工具链,我的宿主机的bazel 配置暴露给容器之后,容器内没有这个程序,导致错误。

当我将`-v $HOME:$HOME` 改为只挂载本项目的文件夹的时候,(`-v $HOME/havenask:$HOME/havenask`) 就可以build 完成。

建议修改一下这里,避免宿主机对容器造成影响。

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with docker/havenask/create_container.sh at line 71 and inspect how the host $HOME directory is mounted when creating the container. Reproduce the build with the current mount, then verify that limiting the mount to the project directory allows the build to complete without host Bazel configuration or toolchain interference.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, shell
Domain
build-system, devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.