我已经在电脑上设置了 docker destop。我运行了简单的“Whalesay”容器以确保一切正常。然后我尝试使用以下 pull 和 run 命令:
docker pull natverse/r-natverse
docker run -p 127.0.0.1:8787:8787 \
-e DISABLE_AUTH=true \
-v "$HOME":/home/rstudio \
natverse/r-natverse
这来自 docker hub 上的“Natverse”,网址为https://hub.docker.com/r/natverse/r-natverse
在容器本身似乎成功下载之后,我在尝试运行它时遇到困难,并出现以下错误消息:
-e : The term '-e' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:3 char:1
+ -e DISABLE_AUTH=true \
+ ~~
+ CategoryInfo : ObjectNotFound: (-e:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
-v : The term '-v' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:4 char:2
+ -v "$HOME":/home/rstudio \
+ ~~
+ CategoryInfo : ObjectNotFound: (-v:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
natverse/r-natverse : The term 'natverse/r-natverse' is not recognized as the name of a cmdlet, function, script file,
or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
try again.
At line:5 char:2
+ natverse/r-natverse
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (natverse/r-natverse:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我尝试卸载 docker 桌面并重新安装最新版本,并重启了电脑。我还确保没有安装 docker 工具箱。我对 docker 不是很熟悉,也不是一个特别技术的人。非常感谢任何帮助!
谢谢你!
答案1
不要转义换行符来将命令扩展为多行,使用停止解析符号并尝试以下操作:
& docker.exe --% pull natverse/r-natverse
& docker.exe --% run -p 127.0.0.1:8787:8787 -e DISABLE_AUTH=true -v "$HOME":/home/rstudio natverse/r-natverse