0

Every time when I start a Docker container my RPi device loses it wireless board configuration. By configuration I mean that it loses its IP address, the DNS resolver and the gateway settings.

Because of that I can't connect to device on net, has anyone had a similar issue before?

# Before Docker container starts
wlan0     Link encap:Ethernet  HWaddr b8:27:eb:a8:93:73  
          inet addr:192.168.0.20  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::ada4:3dc4:b933:7a5b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:525 errors:0 dropped:19 overruns:0 frame:0
          TX packets:411 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:558627 (545.5 KiB)  TX bytes:48299 (47.1 KiB)
# After Docker container starts
wlan0     Link encap:Ethernet  HWaddr b8:27:eb:a8:93:73  
          inet6 addr: fe80::ada4:3dc4:b933:7a5b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5830 errors:0 dropped:19 overruns:0 frame:0
          TX packets:4087 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:5743386 (5.4 MiB)  TX bytes:566484 (553.2 KiB)

Some notes:

  • This happens with any container, not a specific one;
  • To stop the issue I just need to stop all containers that are running.
  • 1
    @techraf I have added more info, hope it helps, please tell me if I should add something else. – Rodrigo Valente Dec 12 '16 at 0:19
  • i am having the same issue but i do know what is the solution. I stopped all the containers but this is did not solve the problem. still i wifi (wlan0) is not recognized in the stretch OS. – Mostafa Apr 12 '18 at 15:56
0

I am facing the same issue, the Wi-Fi gets disconnected after starting one docker container.

The issue has been temporarily resolved by disabling the static IP.

  1. Check the file - /etc/dhcpcd.conf, make sure all the static IP mapped with wlan0/SSIDs are commented out.

  2. Reboot the Raspberry Pi.

  3. Start the container.

Hope it works for you too.

  • It's been a long time that I had this problem. I solved it by a workaround. I'll accept this as the answer, so, if someone else encounter the same problem, maybe it will help him. – Rodrigo Valente Jul 12 '18 at 12:59
1

Your problem cannot be reproduced given the information you provided and here's a minimal, working procedure to prove:

  • start with a fresh Raspbian image on your Raspberry Pi 3

  • login

  • configure Wi-Fi interface (/etc/wpa_supplicant/wpa_supplicant.conf)

    and connect to the network (assuming you get 192.168.0.20 from DHCP)

  • install Docker:

    sudo curl -sSL https://get.docker.com | sh
    
  • run container:

    sudo docker run -d -p 8080:80 lalyos/rpi-nginx
    
  • check the connectivity (on wlan0 interface) from another machine:

    curl 192.168.0.20:8080
    

It works, you should get a short HTML document response containing:

<h1>Welcome to nginx!</h1>

It means wlan0 also works.

  • Well, this has started after I have fixed the IP address for the wifi board through the gui tool in Raspbian. If I connect the RPI through a cable connection, this issue don't happens at all. – Rodrigo Valente Dec 12 '16 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.