docker - 无法使用docker命令启动服务器-挂载目录-OCI运行时错误

标签 docker docker-machine docker-container nvidia-docker docker-command

我想根据以下docker命令启动orthanc服务器。但是,当我执行命令时,出现如下所示的错误。

请注意,orthanc.json和orthanc-db都存在于各自的文件夹中

/orthanc/orthanc.json -orthanc.json位于orthanc文件夹下

/ orthanc / orthanc-db -orthanc-db位于orthanc文件夹下

/etc/orthanc/orthanc.json -orthanc.json位于/ etc / orthanc文件夹下

/ var / lib / orthanc / orthanc-db -orthanc-db位于/ var / lib / orthanc文件夹下

上面列出的所有路径均有效。我能够导航到他们

Docker命令启动orthanc服务器

docker run -p 4242:4242 -p 8042:8042 --rm --name orthanc -v 
/orthanc/orthanc.json:/etc/orthanc/orthanc.json -v /orthanc/orthanc- 
db:/var/lib/orthanc/orthanc-db jodogne/orthanc-plugins /etc/orthanc -- 
verbose

执行命令后出现错误消息
Error response from daemon: OCI runtime create failed: 
container_linux.go:345: starting container process caused "process_lin                           
ux.go:424: container init caused \"rootfs_linux.go:58: mounting 
\\\"/orthanc/orthanc.json\\\" to rootfs \\\"/var/lib/docker/overlay2/                           
48131fde47610cf1bac93d0316e2c1d6dfbfdb90a0e6cc24344cc6a1308eaccd/merged\
\\"at \\\"/var/lib/docker/overlay2/48131fde47610cf1bac93d031                           
6e2c1d6dfbfdb90a0e6cc24344cc6a1308eaccd/merged/etc/orthanc/orthanc.json\
\\"caused \\\"not a directory\\\"\"": unknown: Are you tryin                         
 g to mount a directory onto a file (or vice-versa)? Check if the 
specified host path exists and is the expected type.

您能帮我解决这个问题吗?我正在尝试通过此docker命令启动orthanc服务器。不知道为什么文件存在时会引发错误。

最佳答案

您正在从文件夹所在的同一目录(正在装载的目录)运行容器。这意味着该路径应以当前工作目录作为前缀:

docker run -p 4242:4242 -p 8042:8042 --rm --name orthanc -v $(pwd)/orthanc/orthanc.json:/etc/orthanc/orthanc.json -v $(pwd)/orthanc/orthanc- db:/var/lib/orthanc/orthanc-db jodogne/orthanc-plugins /etc/orthanc -- verbose

关于docker - 无法使用docker命令启动服务器-挂载目录-OCI运行时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56289341/

相关文章:

docker - Kubernetes 容器连接到单独 VPC 中的 RDS 实例

docker - 将 aws 凭据传递给 Docker

python - Docker Compose Volumes 不推送最新代码

docker - 使用commit docker命令的最佳情况是什么?

docker - 我可以从图像运行容器两次吗

node.js - Chrome 中的 Webpack 不完整 block 编码

Dockerfile - 找不到满足 serverlessrepo==0.1.5 要求的版本

networking - 如何使用 Hyper-V 连接到网络设置上的 docker 服务器

bash - 如何在Docker CLI中运行参数化的bash脚本

mongodb - 如何在 kubernetes 中通过身份验证运行 mongo