0

I am trying to run 'ip link add ...' from Dockerfiles's RUN command and getting 'RTNETLINK answers: Operation not permitted' error.

When running a container I can use --cap-add=NET_ADMIN for that, but what about the build command - how do I do this?

rincewind
  • 1,103
  • 8
  • 29
  • Not sure how you would go about doing this, but as to why you're seeing this error.. During the build, your container isn't running, so there are no network devices to operate against. – bluescores Feb 01 '18 at 20:07
  • So 'ip link add' is not "persisted" in an image, and hence cannot be done during a build stage, right? Then, I wonder if either of the following would work: 1) add something into /etc/network/interfaces - but not sure container even processes it 2) Call 'ip link add...' outside of the container, and then 'ip link set dev netns ', somehow? – rincewind Feb 02 '18 at 00:29

0 Answers0