首页 > 解决方案 > 在 docker 容器中运行 delve - debug.test:没有这样的文件或目录

问题描述

当尝试从现有项目的 docker 容器中运行 delve 时,我们得到了这个:

API server listening at: [::]:4040
could not launch process: fork/exec /go/src/github.com/marcosvpj/rey/debug.test: no such file or directory
could not remove /go/src/github.com/marcosvpj/rey/debug.test: remove /go/src/github.com/marcosvpj/rey/debug.test: no such file or directory

尝试在一个全新的项目中运行,使用相同的 Dockerfile,一切正常。寻找文件 - debug.test - 在两个容器中都找不到。

有人知道我需要寻找什么吗?

我得到的最接近的是在常见问题解答中,它表明需要在 docker run 中使用 --security-opt=seccomp:unconfined 。不是这个,因为两个项目都已经在 docker run 命令中有这个


码头工人运行命令:

docker run --security-opt=seccomp:unconfined --rm --net="host" -e LOGGER_LEVEL='error' -v `pwd`:/go/src/github.com/marcosvpj/rey -w /go/src/github.com/marcosvpj/rey rey ./hack/check.sh

标签: dockergoremote-debuggingdelve

解决方案


推荐阅读