Docker 0.0.0.0:55555 已在使用中

Docker 0.0.0.0:55555 already in use

我正在尝试使用 vscode 作为 described here

在 macOS 上为 python 设置精益引擎

当我尝试 运行 容器时,我得到 docker: Error response from daemon: Ports are not available: listen tcp 0.0.0.0:55555: bind: address already in use.

这是日志输出

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

上什么都没有 运行ning
➜  Homestead git:(release) sudo lsof -i:55555
Password:
➜  Homestead git:(release)

无论我是在 VsCode 中执行“运行 在容器中”还是试图通过 docker 桌面 运行 容器,这都是一样的。

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 运行ning。我的主机文件是默认不变的。我唯一安装的是 vagrant with virtual box 和 Laravel homestead vm.

非常感谢任何意见。谢谢观看

更新

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

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

仍然不确定为什么会这样,我希望能够进行调试。如 github 说明中所述,我已在 vscode 中将单声道版本设置为 15.8。我也在我的电脑上安装了 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"

在你的 运行 命令中,去掉 "--debug --debugger-agent=transport=dt_socket,server=y,address=0.0.0.0:55555,suspend= y”。这是在尝试使用相同的端口,这就是为什么您收到地址已在使用错误的原因。

运行 不同端口上的调试器也可以工作,只要它不是您通过 docker.

公开的端口之一

很高兴它有效,谢谢!