Set secomp to unconfined in docker-compose : <p>I need to be able fork a process. As i understand it i need to set the security-opt. I have tried doing this with docker command and it works fine. However when i do this in a docker-compose file it seem to do nothing, maybe I'm not using compose right.</p>

<h1>Docker</h1>

<pre><code>docker run --security-opt=seccomp:unconfined &lt;id&gt; dlv debug --listen=:2345 --headless --log ./cmd/main.go
</code></pre>

<h1>Docker-compose</h1>

<h2>Setup</h2>

<p>docker-compose.yml</p>

<pre><code>networks:
  backend:

services:
  example:
    build: .
    security_opt:
      - seccomp:unconfined
    networks:
      - backend
    ports:
      - "5002:5002"
</code></pre>

<p>Dockerfile</p>

<pre><code>FROM golang:1.8

RUN go get -u github.com/derekparker/delve/cmd/dlv
RUN dlv debug --listen=:2345 --headless --log ./cmd/main.go
</code></pre>

<p>command</p>

<pre><code>docker-compose -f docker-compose.yml up --build --abort-on-container-exit
</code></pre>

<h1>Result</h1>

<blockquote>
  <p>2017/09/04 15:58:33 server.go:73: Using API v1 2017/09/04 15:58:33
  debugger.go:97: launching process with args: [/go/src/debug] could not
  launch process: fork/exec /go/src/debug: operation not permitted</p>
</blockquote>
