dlv无法启动进程,没有此类文件或目录

时间:2019-07-09 18:08:23

标签: docker debugging go delve

Delve在docker中找到我的文件时遇到问题:

could not launch process: open apollo: no such file or directory

我已确保设置了security_opt: - seccomp:unconfined,并且我尝试针对每个golang dlv unable to see source:: no such file or directory设置具有替代路径设置的$ HOME / .dlv / config.yml文件:

substitute-path:
  - {from: /, to: /root}

这是我的设置:

#docker-compose.yml
services:
  service:
    build: .
    ports:
      - '8106:8106'
      - '58257:58257'
    security_opt:
      - seccomp:unconfined
    cap_add:
      - SYS_PTRACE
#Dockerfile
FROM golang:1.11.2

WORKDIR /go/src/cdowney/go/apollo
COPY . .

RUN go install -v -gcflags "all=-N -l" cdowney/go/apollo

RUN chmod +x integ/entrypoint.sh \
    && go get github.com/derekparker/delve/cmd/dlv

RUN mkdir $HOME/.dlv
COPY integ/dlv-config.yml $HOME/.dlv/config.yml

CMD ["integ/entrypoint.sh"]
#entrypoint.sh
dlv --listen=:58257 --headless=true --api-version=2 exec /go/bin/apollo -- integ/temp.json
#config.yml
substitute-path:
  - {from: /, to: /root}

delve启动,但无法启动服务并无法连接到服务。该服务确实可以启动,但是delve似乎没有附加到该服务上进行调试:

API server listening at: [::]:58257
2019-07-09T17:30:26Z info layer=debugger launching process with args: [apollo integ/config.json]
could not launch process: open apollo: no such file or directory 
Listening on port 8106...

我们将不遗余力地帮助您识别文件。

0 个答案:

没有答案