Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker: get access to wifi interface

I am pretty new to docker. At the moment I want to maintain a network of different Rapsberry PIs. Each PI should have the same OS with exactly the same system running. To handle deployment and updates of Software, I want to handle these things by docker.

Currently I am using HypriotOS, which offers docker on their Images.

My Main goal is to run an applocation in the docker containers, which need to access the wifi interface directly. The pure network access won't be enough, there needs to be deeper access like changing the wifi mode (Monitor Mode).

Long Story short: is it possible to passthrough an USB WiFi card directly to the docker Container, that it appears as wlan0 interface? Or are there other ways that you can think of?

Thanks for your answers in advance!

like image 275
svennergr Avatar asked May 03 '15 21:05

svennergr


People also ask

Can Docker access local network?

docker run --network="host" Alternatively you can run a docker container with network settings set to host . Such a container will share the network stack with the docker host and from the container point of view, localhost (or 127.0.0.1 ) will refer to the docker host.

How do I find my Docker bridge IP address?

Inspect the bridge network to see what containers are connected to it. Near the top, information about the bridge network is listed, including the IP address of the gateway between the Docker host and the bridge network ( 172.17. 0.1 ).

How do I view a container network?

Run a docker network ls command to view existing container networks on the current Docker host. The output above shows the container networks that are created as part of a standard installation of Docker. New networks that you create will also show up in the output of the docker network ls command.

How does Docker container get IP address?

By default, the container is assigned an IP address for every Docker network it connects to. The IP address is assigned from the pool assigned to the network, so the Docker daemon effectively acts as a DHCP server for each container. Each network also has a default subnet mask and gateway.


1 Answers

Take a look at the privileged flag for your container, it will give you full access to the devices on the system. See the Docker Run Documention for more information.

like image 154
Michael Avatar answered Oct 06 '22 23:10

Michael