fork/exec ./debug: operation not permitted

According Delve Issue #515

Docker has security settings preventing ptrace(2) operations by default with in the container. Pass --security-opt seccomp:unconfined to docker run when starting.

*confirmation of this in official docker bug tracker https://github.com/docker/docker/issues/21051


It seems to work if you start the container with --privileged. I've tried to figure out if there is a more fine-grained capability but failed.

Also I just found https://github.com/steeve/homebrew-delve which should make things easier on OSX.


Docker has security settings preventing ptrace(2)

See how i fixed it.

if using a docker-compose file to run the container then append seccomp:unconfined in the services section like below

api: 
  security_opt:
    - seccomp:unconfined

if using docker run ...passing seccomp:unconfined works as well

Tags:

Docker

Go

Delve