【发布时间】:2022-01-06 20:52:43
【问题描述】:
背景
我正在运行一个 docker 镜像,例如来自 facebook 的 readme:
cd docker/1.1.0/
docker build -t infer .
# mount the local examples directory inside the image
# you can mount your project directory here instead
docker run -it -v $PWD/../../examples:/infer-examples infer /bin/bash
# you should now be inside the docker container with a shell prompt, e.g.
# "root@5c3b9af90d59:/# "
cd /infer-examples/
infer -- clang -c hello.c
但是,逐字尝试示例和安装我自己的项目目录,就像它提到的那样让我一无所获。下面是我运行它时挂载我的项目目录:
在创建 infer docker 镜像时如何正确绑定挂载我的项目目录?
【问题讨论】:
-
它说挂载你的本地示例目录。您的系统上是否有一个正在运行 docker 容器的系统?
-
与您发布的命令中的行相比,您的命令(您发布的图像中的第一行)看起来很奇怪。里面有很多空格和'analyze-this'。
-
@HansKilian 这是一个编辑。这只是我的代码所在的另一个目录。