gpt4 book ai didi

macos - 如何在 docker 中运行库 - 困惑

转载 作者:行者123 更新时间:2023-12-02 19:37:21 25 4
gpt4 key购买 nike

我正在尝试使用 microsoft's cntk library在 Mac 上;为此,我使用 Docker .不过,我不是这一切的专家,所以我很难弄清楚如何让它发挥作用。

据我了解,Docker 提供了一种在虚拟化环境中运行应用程序的方法,而无需虚拟化整个操作系统。因此,您下载(或创建)图像,然后在“容器”中运行它们。

好的,所以我关注了required steps使 cntk 库在 Docker 上工作;如果我列出图像,我会发现

$: docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
microsoft/cntk latest c2c192036e19 7 days ago 5.92 GB
ubuntu 14.04 7c09e61e9035 5 weeks ago 188 MB
hello-world latest 48b5124b2768 2 months ago 1.84 kB

此时我想运行cntk 存储库中的教程。我已经在我的桌面上下载了 cntk 存储库的主分支,并尝试运行“教程”文件夹中的示例之一,但我收到以下错误:
terminal~ username$  docker run -w /Users/username/Desktop/CNTK-master/Tutorials microsoft/cntk configFile=lr_bs.cntk
container_linux.go:247: starting container process caused "exec: \"configFile=lr_bs.cntk\": executable file not found in $PATH"
docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"configFile=lr_bs.cntk\": executable file not found in $PATH".
ERRO[0001] error getting events from daemon: net/http: request canceled
terminal~ username$

基本上我用 -w 标志调用 docker run 来通知他文件在哪里,但它不起作用。我尝试在网上搜索,但我不清楚如何解决这个问题。我应该创建一个新图像吗?我应该用不同的参数调用 docker run 命令吗?

最佳答案

-w flag 设置工作目录,它只是容器内的默认目录。您的目录在主机上,所以它在这里不起作用。相反,您需要使用卷将主机上的目录挂载到容器中。您链接的文档中的最后一段有一个示例:

$ docker run --name cntk_container1 -ti -v /project1/data:/data -v /project1/config:/config cntk bash

关于macos - 如何在 docker 中运行库 - 困惑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43320919/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com