Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/308.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Docker 0.0.0.0:55555已在使用_Python_Visual Studio_Docker_Macos Big Sur_Quantconnect - Fatal编程技术网

Python Docker 0.0.0.0:55555已在使用

Python Docker 0.0.0.0:55555已在使用,python,visual-studio,docker,macos-big-sur,quantconnect,Python,Visual Studio,Docker,Macos Big Sur,Quantconnect,我正在尝试在macos上使用vscode为python设置精益引擎 当我尝试运行容器时,我得到 docker:daemon的错误响应:端口不可用:侦听tcp 0.0.0.0:55555:bind:address已在使用。 这是日志输出 A Lean container is halted and will be removed. Continue? [y/n]: y LeanEngine Pulling Docker image: quantconnect/lean:latest latest:

我正在尝试在macos上使用vscode为python设置精益引擎

当我尝试运行容器时,我得到
docker:daemon的错误响应:端口不可用:侦听tcp 0.0.0.0:55555:bind:address已在使用。

这是日志输出

A Lean container is halted and will be removed. Continue? [y/n]: y
LeanEngine
Pulling Docker image: quantconnect/lean:latest
latest: Pulling from quantconnect/lean
Digest: sha256:ff6d17d055d27da2adcde8743628768880129ea68496e8b85a94d699543664db
Status: Image is up to date for quantconnect/lean:latest
docker.io/quantconnect/lean:latest
Launching LeanEngine with command: 
docker run --rm     --mount type=bind,source=/Users/odelibalta/Documents/Code/GitHub/Lean/Launcher/config.json,target=/Lean/Launcher/config.json,readonly     -v /Users/odelibalta/Documents/Code/GitHub/Lean/Data:/Data:ro     -v /Users/odelibalta/Documents/Code/GitHub/Lean/Results:/Results     --name LeanEngine     -p 5678:5678     --expose 6000 -v /Users/odelibalta/Documents/Code/GitHub/Lean/Algorithm.Python:/Lean/Algorithm.Python -p 55555:55555     --entrypoint mono     quantconnect/lean:latest --debug --debugger-agent=transport=dt_socket,server=y,address=0.0.0.0:55555,suspend=y     QuantConnect.Lean.Launcher.exe --data-folder /Data --results-destination-folder /Results --config /Lean/Launcher/config.json
docker: Error response from daemon: Ports are not available: listen tcp 0.0.0.0:55555: bind: address already in use.
ERRO[0000] error waiting for container: context canceled 
所以我现在很困惑,因为我没有在55555上运行任何东西

➜  Homestead git:(release) sudo lsof -i:55555
Password:
➜  Homestead git:(release)
无论我是在VsCode中执行“在容器中运行”,还是试图通过docker desktop运行容器,这都是相同的

docker ps -a
CONTAINER ID   IMAGE                      COMMAND                  CREATED              STATUS    PORTS     NAMES
416ab7089c13   quantconnect/lean:latest   "mono --debug --debu…"   About a minute ago   Created             LeanEngine
我没有运行任何nginx或apache。“我的主机”文件是默认的未更改文件。我只安装了一个虚拟盒子和一个Laravel homestead虚拟机

我非常感谢您的任何意见。谢谢你的关注

更新

感谢Terry的评论,我现在知道这与调试选项有关。当我禁用调试,然后在容器中运行调试时,它会一直运行。与上面的命令相比,它运行下面的命令

docker run --rm     --mount type=bind,source=/Users/odelibalta/Documents/Code/GitHub/Lean/Launcher/config.json,target=/Lean/Launcher/config.json,readonly     -v /Users/odelibalta/Documents/Code/GitHub/Lean/Data:/Data:ro     -v /Users/odelibalta/Documents/Code/GitHub/Lean/Results:/Results     --name LeanEngine     -p 5678:5678     --expose 6000 -v /Users/odelibalta/Documents/Code/GitHub/Lean/Algorithm.Python:/Lean/Algorithm.Python quantconnect/lean:latest --data-folder /Data --results-destination-folder /Results --config /Lean/Launcher/config.json
仍然不确定为什么会发生这种情况,我希望能够进行调试。我已经在vscode中将mono版本设置为15.8,如github说明中所述。我也在我的计算机上安装了15.8版本,但是我得到了以下输出

Lean git:(master) ✗ msbuild --version
Microsoft (R) Build Engine version 16.0.38-preview+g300887e680 for Mono
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1001: Unknown switch.
Switch: --version

For switch syntax, type "MSBuild /help"

在run命令中,去掉“-debug--debugger agent=transport=dt_套接字,server=y,address=0.0.0.0:55555,suspend=y”。这是试图使用相同的端口,这就是为什么您得到的地址已经在使用错误

只要不是通过docker公开的端口之一,在其他端口上运行调试器也可以工作


很高兴它能工作,谢谢

调试器代理端口是否与实际端口冲突?您是否可以尝试不使用调试配置来查看它是否启动?如果是这样的话,我猜您需要为调试代理指定一个不同的端口。谢谢您的评论。如何找到这些信息?在run命令中,去掉“-debug--debugger agent=transport=dt_socket,server=y,address=0.0.0.0:55555,suspend=y”并查看是否出现相同的错误。我已更新了原始帖子。这是因为当我关闭调试时,container命令会完全执行。新的错误只意味着--version不是有效的语句。我不使用mono,所以不确定我能帮上多大的忙,但我想如果你想使用调试器,你需要在55555以外的端口上运行它,因为这是你用来链接主机/容器的端口。容器现在是否在没有调试语句的情况下成功启动?