I have the need to passthrough a WLAN Interface into a Docker container.
My goal is to setup the container so, that it uses the WLAN Interface to create a AP and Captive Portal.
I created a base image with the tools I need and copied some configs into it:
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update &&
apt-get install -y --no-install-recommends
hostapd
dnsmasq
iproute2
iputils-ping
net-tools
vim
sudo
systemctl
&& apt-get clean && rm -rf /var/lib/apt/lists/*
COPY config/hostapd.conf /etc/hostapd/hostapd.conf
COPY config/dnsmasq.conf /etc/dnsmasq.conf
WORKDIR /root
#EXPOSE 67/udp 53/udp 80
CMD ["/bin/bash"]
So my question is, how do I start the container so that my WLAN device appears in the container?
This does not work:
docker run -it --rm --cap-add=NET_ADMIN --device /dev/net/tun --device /sys/class/net/wlx90de80a028e9 test-ap bash`
And fails with:
docker: Error response from daemon: error gathering device information while adding custom device "/sys/class/net/wlx90de80a028e9": not a device node.