go-container-debugging
go-container-debugging copied to clipboard
security_opt required for Linux
On my CentOS Linux machine, I have to uncomment these security options:
https://github.com/olivere/go-container-debugging/blob/933d56bbde5a4f05b2252739ce543fd39e77508f/docker-compose.yml#L11-L13
If not, I get this error:
▰ master go-container-debugging ▸ docker-compose up --build
Creating network "gocontainerdebugging_default" with the default driver
Building app
Step 1/6 : FROM golang
---> f50db16df5da
Step 2/6 : WORKDIR /go/src/github.com/olivere/go-container-debugging
---> Using cache
---> ac7270887d71
Step 3/6 : EXPOSE 8080 2345
---> Using cache
---> aad1efccc5d1
Step 4/6 : RUN go get github.com/derekparker/delve/cmd/dlv
---> Using cache
---> b41bda8c957b
Step 5/6 : ADD . /go/src/github.com/olivere/go-container-debugging
---> 3623b102b681
Step 6/6 : CMD ["dlv", "debug", "github.com/olivere/go-container-debugging", "--headless", "--listen=:2345", "--api-version=2", "--log"]
---> Running in ea53cba10718
Removing intermediate container ea53cba10718
---> b47bb192f0c6
Successfully built b47bb192f0c6
Successfully tagged gocontainerdebugging_app:latest
Creating gocontainerdebugging_app_1 ...
Creating gocontainerdebugging_app_1 ... done
Attaching to gocontainerdebugging_app_1
app_1 | API server listening at: [::]:2345
app_1 | 2019-07-16T14:10:25Z info layer=debugger launching process with args: [/go/src/github.com/olivere/go-container-debugging/__debug_bin]
app_1 | could not launch process: fork/exec /go/src/github.com/olivere/go-container-debugging/__debug_bin: operation not permitted
gocontainerdebugging_app_1 exited with code 1
Apart from this, it works great. Thanks for the demo!