Container with --cap-add=NET_ADMIN

sudo docker run -it --rm --cap-add=NET_ADMIN ubuntu:14.04 ip link add dummy0 type dummy
Unable to find image ‘ubuntu:14.04’ locally
14.04: Pulling from library/ubuntu
0db3a87a3d79: Pull complete
a748e5c22d98: Pull complete
77801623468b: Pull complete
Digest: sha256:5c01e896fa6eeaa41f3509c64af668d71d06e318cfe373dabab9d61b9eaf6441
Status: Downloaded newer image for ubuntu:14.04
pi@SERVER:/var/lib/docker/containers $ sudo docker container ls -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
da6af5fa8db4 debian “–cap-add=NET_ADMIN” About a minute ago Created test
pi@SERVER:/var/lib/docker/containers $ sudo docker start test
Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: “–cap-add=NET_ADMIN”: executable file not found in $PATH: unknown
Error: failed to start containers: test
pi@SERVER:/var/lib/docker/containers $

Just out of curriousity:

Does the username “pi” indicate that it’s running on a Raspberry Pi?

The container starts on my x86_64 system but suffers from a different problem:

me@swarm1:~$ docker run -it --rm --cap-add=NET_ADMIN ubuntu:14.04 ip link add dummy0 type dumm
Unable to find image 'ubuntu:14.04' locally
14.04: Pulling from library/ubuntu
2e6e20c8e2e6: Extracting [=========================>                         ]  36.21MB/70.69MB
0551a797c01d: Download complete
2e6e20c8e2e6: Extracting [===========================================>       ]  61.83MB/70.69MB
2e6e20c8e2e6: Pull complete
0551a797c01d: Pull complete
512123a864da: Pull complete
Digest: sha256:5c01e896fa6eeaa41f3509c64af668d71d06e318cfe373dabab9d61b9eaf6441
Status: Downloaded newer image for ubuntu:14.04



RTNETLINK answers: Operation not supported

I am not going to follow up on the RTNETLINK problem - as its not part of your OP and I have no use for it…

How do I stop the container being deleted

You didn’t answer my post and shared no valuable details that allows to understand why it’s working for me, but not for you.

1 Like

How am I supposed to know, I fixed that part by not including ip link dummy0 type dummy

How do I stop the container being deleted

Does anyone know how to help

well as I have been told to do
Here Is how I solved this

sudo docker run -it --cap-add=NET_ADMIN debian