10

I have to add some rule to iptables, in the build process it give me an error because i need privilege so is there any way to get around it, i know that there no privilege option in build, or can i build and image without run it ?

1 Answers1

2

It's considered better practice from what I understand to use specific kernel capabilities:

docker run --cap-add NET_ADMIN <image> <command>

should get you what you need. You may need to also add SYS_ADMIN as well.

Patrick
  • 599