NetfilterQueue not working in a docker container

NetfilterQueue is showing a weird problem when importing in a python script running in a container:

File "main.py", line 1, in <module>
    from netfilterqueue import NetfilterQueue
ImportError: /usr/local/lib/python2.7/dist-packages/netfilterqueue.so: undefined symbol: nfq_set_verdict2

In the container, I have installed:

  • Hadoop “Unable to load native-hadoop library for your platform” error on docker-spark?
  • docker: java based application resource duplication
  • What are benefits of having jenkins master in a docker container?
  • My websites running in docker containers, how to implement virtual host?
  • Running nodeJS app, selenium and webdriver.io tests in docker container
  • Docker tag flag not working when building from Dockerfile
  • FROM debian:wheezy
    RUN apt-get update && apt-get install -y \
        bridge-utils \
        net-tools \
        iptables \
        python \ 
        scapy \
        tcpdump \
        python-nfqueue \
        build-essential \
        python-dev \
        libnetfilter-queue-dev \
        python-pip
    
    RUN pip install netfilterqueue
    
    COPY ./main.py /main.py
    
    ENTRYPOINT  sysctl net.ipv6.conf.all.forwarding=1 && ip6tables -A FORWARD -j NFQUEUE --queue-num 1 && python main.py
    

    Build is working like a charm. Any idea what could cause this error on runtime?

    Thanks for the help

  • Storing base java project inside child project jar (maven, docker)
  • How to package files with docker image
  • How to setup development environment easily?
  • Run two docker compose with same static ip on a host
  • Why so many layers on base images? Docker
  • dockerfile with windows path
  • One Solution collect form web for “NetfilterQueue not working in a docker container”

    FYI I was able to fix this by using ubuntu as the base instead of debian. The container host is also ubuntu. I started the container with –privileged and –net=host

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.