bash - 尝试映射目录时bash替换错误
问题描述
我正在尝试将路径映射到工作目录这里是命令代码
docker run --runtime=nvidia --privileged -it -v ${/home/segun/tf3d}:/tf3d -w/tf3d/ops tensorflow/tensorflow:custom-op-gpu-ubuntu16
错误是:
bash: ${/home/segun/tf3d}:/tf3d: bad substitution
文档说:
docker run --runtime=nvidia --privileged -it -v ${PWD}:/working_dir -w /working_dir tensorflow/tensorflow:custom-op-gpu-ubuntu16
解决方案
${PWD}
is a variable of the current working directory, so if you hardcode you don't need the ${}
.
so just instead of ${/home/segun/tf3d}
it should be just the path /home/segun/tf3d
or run with ${PWD}
in the folder /home/segun/tf3d
also, you miss a space between -w and the working folder path
推荐阅读
- c# - 为什么 Unity 不能识别这个 DLL - 是不是放错地方了?
- javascript - 强制表格导航向下行然后跨到下一列
- c# - C# FireStore,从文档中获取值
- powerbi - 两个运行总查询之间的差异
- android - TextView 在旧文本之上覆盖新文本,而不是替换它。(科特林 - 安卓)
- google-sheets - 从不断增长的范围中检索月份(Google 表格)
- typescript - 如何使用 Jest 模拟 Es6 类?
- linux - 如何在 Linux 上使用 mmap 系统调用解决我在此 x86-64 汇编代码中遇到的 EINVAL 和 EPERM 错误
- apache-spark - 超出 GC 开销限制 - Databricks 内存不足
- ruby - 抓取缺少 url / ruby 的网站