Docker Community Forums

Share and learn in the Docker community.

How to install iptables module inside Docker container

How to install iptables module inside Docker container?

The containers use the same kernel (and the same modules) as the host. Maybe it’s possible to trigger module load from inside the container, but I’m not sure which permission/capability that’s needed. You can always run modprobe on the host instead.
AFAIK you also need --cap-add NET_ADMIN to use iptables in the container.

You can install it just like you would install any software on Linux using apt.
apt update && apt install iptables should do the job.