Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fork/exec ./debug: operation not permitted

Tags:

docker

go

delve

My goal is to be able to remote debug from Atom.io. into a docker container running go in dlv debugger. This is the first problem:

Update:1. I am running Docker container on a mac, but that should not influence the code signing thing as I am running in a container, right?

Update:2. Codesignig the host, did not help.

Error:

1. root@...:/go/src/app# go get github.com/derekparker/delve/cmd/dlv

2. root@...:/go/src/app# dlv debug hello.go

could not launch process: fork/exec ./debug: operation not permitted

Then tried to

1. root@...:/go/src/app# sudo

2. bash: sudo: command not found
like image 775
Chris G. Avatar asked Mar 06 '16 14:03

Chris G.


2 Answers

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

like image 90
CAMOBAP Avatar answered Sep 28 '22 09:09

CAMOBAP


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.

like image 40
Mattias Wadman Avatar answered Sep 28 '22 09:09

Mattias Wadman