You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi :-) It would be really nice to see an official docker-contianer for this software :-). Because I use to run software ONLY in container like rancher os (keeps mantainance low). Any possibility to see this? :-) maybe I can help developing :-)
Reacted by Heartlander, MaxPeal, fam4r and Chris Lowder
enlighten me, please. how does docker handle management of the host’s network interfaces? built-in and usb dongles? can you run hostapd inside a container?
I managed to run RaspAP within a Docker container without it being privileged or running within the host network namespace (the wifi interface must be moved into the container netns so to speak) for some security concerns.
I still stumble upon some web interface errors but nothing serious as the AP is working great so far so I need to do some more tweaks as well as checking the capabilities needed before sharing my work to you if you are interested.
Reacted by bf8392, Norbert, glaszig, Antoine GRÉA, Daniel Wilson, Mikhail Korobkov and Cat coder
Wow that's great! Yes I'm always interested in dockerized apps :-) thanks for all the effort you've done! @noxPHX. Maybe you can post it here, so the docker can become official and others can use it :-). Very cool that you've done it :-)
However, we could also investigate what breaks RaspAP when docker is installed on the same system and how we can fix it? The install process for RaspAP is pretty streamlined as it is. A docker container might be overkill for how many systemd services are involved. It may turn into a docker-compose deployment, behind more networking complexity.
I think the investigation approach also solves @danielwilson654 's problem. We just want to run Docker and RaspAP on the same Pi.
Hi, I have a spare Pi I can qualify with the Balena docker image. I have more container/Linux know-how since last year so I should be able to assist more. Things like adblock and VPN should work if we set --network=host. Interacting with hardware will be done with the --privileged flag. Essentially we'll be using the docker container to isolate all the config files and processes, but with none of the networking abstractions.
We'll want to make sure nothing on the host system will clash with what's being described in the RaspAP container. Disabling daemons like wpa-supplicant outside the container might be necessary. It might take some work to get it feature-compatible...and it might take more than just a docker run for the end-user.
Ok. I think I'm where you're at. The guide at https://github.com/RaspAP/raspap-docker still works where the webgui comes up. But starting the hotspot in the container fails:
Nov 02 21:10:02 jpi systemd[1]: hostapd.service: Service RestartSec=2s expired, scheduling restart.
Nov 02 21:10:02 jpi systemd[1]: hostapd.service: Scheduled restart job, restart counter is at 8.
Nov 02 21:10:02 jpi systemd[1]: Stopped Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
Nov 02 21:10:02 jpi systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator...
Nov 02 21:10:02 jpi systemd[1]: hostapd.service: Control process exited, code=exited, status=1/FAILURE
Nov 02 21:10:02 jpi systemd[1]: hostapd.service: Failed with result 'exit-code'.
Nov 02 21:10:02 jpi systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
...but that's a separate problem we can get to once we're on Balena.
I remember now that the jrcichra/raspapd is based on some random outdated systemd container. A potential first step is getting systemd running in Balena. The downside of systemd in a container is...when you're building the container, systemd is not running. So the install script needs to do systemctl enable <service> and not systemctl enable --now <service>. That's why in the existing container, I have the user do the install script by hand.
So step 1 seems to be Balena systemd to support hostapd, dnsmasq, dhcpcd, lighttpd, etc easily. https://github.com/alehaa/docker-debian-systemd might be a good reference we can slide Balena under.
I'm where I was at before. Using Belena as a base is much nicer, especially with install_packages. I'm getting this output for hostapd when enabling the hotspot:
Nov 02 22:20:21 jpi systemd[1]: Stopped Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
Nov 02 22:20:21 jpi systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator...
Nov 02 22:20:21 jpi hostapd[562]: Configuration file: /etc/hostapd/hostapd.conf
Nov 02 22:20:21 jpi hostapd[562]: rfkill: WLAN soft blocked
Nov 02 22:20:21 jpi hostapd[562]: wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
Nov 02 22:20:21 jpi hostapd[562]: wlan0: Could not connect to kernel driver
Nov 02 22:20:21 jpi hostapd[562]: Using interface wlan0 with hwaddr b8:27:eb:97:25:f1 and ssid "raspi-webgui"
Nov 02 22:20:21 jpi hostapd[562]: Failed to set beacon parameters
Nov 02 22:20:21 jpi hostapd[562]: wlan0: Could not connect to kernel driver
Nov 02 22:20:21 jpi hostapd[562]: Interface initialization failed
Nov 02 22:20:21 jpi hostapd[562]: wlan0: interface state COUNTRY_UPDATE->DISABLED
Nov 02 22:20:21 jpi hostapd[562]: wlan0: AP-DISABLED
Nov 02 22:20:21 jpi hostapd[562]: wlan0: Unable to setup interface.
Nov 02 22:20:21 jpi hostapd[562]: wlan0: interface state DISABLED->DISABLED
Nov 02 22:20:21 jpi hostapd[562]: wlan0: AP-DISABLED
Nov 02 22:20:21 jpi hostapd[562]: wlan0: CTRL-EVENT-TERMINATING
Nov 02 22:20:21 jpi hostapd[562]: hostapd_free_hapd_data: Interface wlan0 wasn't started
Nov 02 22:20:21 jpi hostapd[562]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Nov 02 22:20:21 jpi systemd[1]: hostapd.service: Control process exited, code=exited, status=1/FAILURE
Nov 02 22:20:21 jpi systemd[1]: hostapd.service: Failed with result 'exit-code'.
Nov 02 22:20:21 jpi systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
It looks like we can't interact with the wlan0 kernel driver:
Nov 02 22:20:21 jpi hostapd[562]: wlan0: Could not connect to kernel driver
...even though we should be able to interact with the host kernel (in theory).
I got here by doing:
docker build -t jrcichra/balena-systemd .
docker run --name raspap -it -d --privileged --network=host -v /sys/fs/cgroup:/sys/fs/cgroup:ro --cap-add SYS_ADMIN jrcichra/balena-systemd
docker exec -it raspap bash
curl -sL https://install.raspap.com | bash
... go through the prompts saying yes
let it restart the container
docker restart raspap
Then the webgui should appear on port 80 and if you do
journalctl -u hostapd -f
...while trying to turn on Hotspotting you should be in the same boat with the wlan0 failure.
Ok, by dealing with rfkill and disabling systemd-resolved + wpa_supplicant where I could, I was able to start up hostapd and dnsmasq in the container. I can see the wifi SSID and the password works. Where I'm stuck now is with dnsmasq-dhcp. I can't get an IP address from the AP. I'm getting this error, but the config (I believe) is set up properly to serve dhcp:
==> 090_wlan0.conf <==
# RaspAP wlan0 configuration
interface=wlan0
dhcp-range=10.3.141.50,10.3.141.255,0.0.0.0,12h
dhcp-option=6,1.1.1.1,1.0.0.1
==> README <==
# All files in this directory will be read by dnsmasq as
# configuration files, except if their names end in
# ".dpkg-dist",".dpkg-old" or ".dpkg-new"
#
# This can be changed by editing /etc/default/dnsmasq
root@jpi:/etc/dnsmasq.d# tail -f /tmp/dnsmasq.log
Nov 2 23:10:27 dnsmasq[1145]: using nameserver 10.0.0.1#53
Nov 2 23:10:27 dnsmasq[1145]: read /etc/hosts - 5 addresses
Nov 2 23:10:29 dnsmasq[1145]: read /etc/raspap/adblock/hostnames.txt - 142490 addresses
Nov 2 23:10:35 dnsmasq-dhcp[1145]: no address range available for DHCP request via wlan0
Nov 2 23:10:39 dnsmasq-dhcp[1145]: no address range available for DHCP request via wlan0
Nov 2 23:10:44 dnsmasq-dhcp[1145]: no address range available for DHCP request via wlan0
Nov 2 23:10:49 dnsmasq-dhcp[1145]: no address range available for DHCP request via wlan0
Nov 2 23:10:53 dnsmasq-dhcp[1145]: no address range available for DHCP request via wlan0
Nov 2 23:11:02 dnsmasq-dhcp[1145]: no address range available for DHCP request via wlan0
Nov 2 23:11:16 dnsmasq-dhcp[1145]: no address range available for DHCP request via wlan0
root@jpi:/etc/dnsmasq.d# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:c2:70:a4 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.182/24 brd 10.0.0.255 scope global dynamic noprefixroute eth0
valid_lft 85808sec preferred_lft 75008sec
inet6 fd38:65c3:b703:0:2080:69f:2cd0:851/64 scope global mngtmpaddr noprefixroute
valid_lft forever preferred_lft forever
inet6 fdb3:dd5c:79f7:0:e0d2:632b:a43b:2b51/64 scope global mngtmpaddr noprefixroute
valid_lft forever preferred_lft forever
inet6 fe80::c106:e0a:badc:12c9/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:97:25:f1 brd ff:ff:ff:ff:ff:ff
inet 169.254.151.177/16 brd 169.254.255.255 scope global noprefixroute wlan0
valid_lft forever preferred_lft forever
inet6 fe80::f46f:c75e:5fbd:ad5b/64 scope link
valid_lft forever preferred_lft forever
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:01:9f:bf:c4 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
root@jpi:/etc/dnsmasq.d#
@jrcichra Not sure it helps, but this is how I usually setup dnsmasq/dhcp:
interface=wlan0 # Listening interface
dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h
# Pool of IP addresses served via DHCP
domain=wlan # Local wireless DNS domain
@luandro yeah, I'd think that would work but for some reason it doesn't:
root@jpi:/etc/dnsmasq.d# head -999 *
==> 090_adblock.conf <==
conf-file=/etc/raspap/adblock/domains.txt
addn-hosts=/etc/raspap/adblock/hostnames.txt
==> 090_raspap.conf <==
# RaspAP default config
log-facility=/tmp/dnsmasq.log
conf-dir=/etc/dnsmasq.d
log-dhcp
log-queries
==> 090_wlan0.conf <==
interface=wlan0 # Listening interface
dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h
# Pool of IP addresses served via DHCP
domain=wlan # Local wireless DNS domain
==> README <==
# All files in this directory will be read by dnsmasq as
# configuration files, except if their names end in
# ".dpkg-dist",".dpkg-old" or ".dpkg-new"
#
# This can be changed by editing /etc/default/dnsmasq
systemctl restart dnsmasq
root@jpi:/etc/dnsmasq.d# tail -f /tmp/dnsmasq.log
Nov 2 23:31:54 dnsmasq-dhcp[1244]: DHCP, IP range 192.168.4.2 -- 192.168.4.20, lease time 1d
Nov 2 23:31:54 dnsmasq[1244]: reading /etc/resolv.conf
Nov 2 23:31:54 dnsmasq[1244]: using nameserver 10.0.0.1#53
Nov 2 23:31:54 dnsmasq[1244]: read /etc/hosts - 5 addresses
Nov 2 23:31:56 dnsmasq[1244]: read /etc/raspap/adblock/hostnames.txt - 142490 addresses
Nov 2 23:32:16 dnsmasq-dhcp[1244]: no address range available for DHCP request via wlan0
Nov 2 23:32:18 dnsmasq-dhcp[1244]: no address range available for DHCP request via wlan0
Nov 2 23:32:22 dnsmasq-dhcp[1244]: no address range available for DHCP request via wlan0
Nov 2 23:32:31 dnsmasq-dhcp[1244]: no address range available for DHCP request via wlan0
Nov 2 23:32:48 dnsmasq-dhcp[1244]: no address range available for DHCP request via wlan0
Nov 2 23:32:56 dnsmasq-dhcp[1244]: no address range available for DHCP request via wlan0
Nov 2 23:33:01 dnsmasq-dhcp[1244]: no address range available for DHCP request via wlan0
Nov 2 23:33:05 dnsmasq-dhcp[1244]: no address range available for DHCP request via wlan0
Nov 2 23:33:14 dnsmasq-dhcp[1244]: no address range available for DHCP request via wlan0
^C
root@jpi:/etc/dnsmasq.d# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:c2:70:a4 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.182/24 brd 10.0.0.255 scope global dynamic noprefixroute eth0
valid_lft 84455sec preferred_lft 73655sec
inet6 fd51:de9e:9c6d:0:2404:4818:84c2:454a/64 scope global mngtmpaddr noprefixroute
valid_lft forever preferred_lft forever
inet6 fd32:db85:3f4f:0:db2a:61b0:9b30:ebe3/64 scope global mngtmpaddr noprefixroute
valid_lft forever preferred_lft forever
inet6 fd38:65c3:b703:0:2080:69f:2cd0:851/64 scope global mngtmpaddr noprefixroute
valid_lft forever preferred_lft forever
inet6 fdb3:dd5c:79f7:0:e0d2:632b:a43b:2b51/64 scope global mngtmpaddr noprefixroute
valid_lft forever preferred_lft forever
inet6 fe80::c106:e0a:badc:12c9/64 scope link
valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:97:25:f1 brd ff:ff:ff:ff:ff:ff
inet 169.254.151.177/16 brd 169.254.255.255 scope global noprefixroute wlan0
valid_lft forever preferred_lft forever
inet6 fe80::f46f:c75e:5fbd:ad5b/64 scope link
valid_lft forever preferred_lft forever
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
link/ether 02:42:01:9f:bf:c4 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
valid_lft forever preferred_lft forever
root@jpi:/etc/dnsmasq.d#
Activity
mlavelle42 commentedon Jan 24, 2020
Second this request.
billz commentedon Jan 27, 2020
@bd8392 I don't really have bandwidth for this now, but if you'd like to kickstart things perhaps myself and others could collaborate on it :)
glaszig commentedon Mar 1, 2020
enlighten me, please. how does docker handle management of the host’s network interfaces? built-in and usb dongles? can you run hostapd inside a container?
glaszig commentedon Mar 1, 2020
sorry, i enlightened myself. apparently you can indeed. looks like quite some work: https://github.com/fgg89/docker-ap
bf8392 commentedon Mar 1, 2020
By bind the etc/interfaces to docker as volume, you can alter it's settings...maybe this is easier...
glaszig commentedon Mar 1, 2020
glaszig commentedon Mar 1, 2020
go, go, go!
noxPHX commentedon Mar 10, 2020
I managed to run RaspAP within a Docker container without it being privileged or running within the host network namespace (the wifi interface must be moved into the container netns so to speak) for some security concerns.
I still stumble upon some web interface errors but nothing serious as the AP is working great so far so I need to do some more tweaks as well as checking the capabilities needed before sharing my work to you if you are interested.
bf8392 commentedon Mar 11, 2020
Wow that's great! Yes I'm always interested in dockerized apps :-) thanks for all the effort you've done! @noxPHX. Maybe you can post it here, so the docker can become official and others can use it :-). Very cool that you've done it :-)
1ubuntuuser commentedon May 25, 2020
Great stuff! I heavily use docker so because of #579 a direct install of raspAP won't work in my situation.
@noxPHX Any progress on the container? if not perhaps share the docker image so we can work on it together?
Edit:
I meant Dockerfile, not image.
jrcichra commentedon Jun 10, 2020
I would also be interested in helping with this. Interoperability of raspap and docker would be very beneficial for me.
billz commentedon Jun 10, 2020
How about a new repo dedicated to this, with participants on this issue as collaborators?
jrcichra commentedon Jun 11, 2020
Sure @billz that works for me.
However, we could also investigate what breaks RaspAP when docker is installed on the same system and how we can fix it? The install process for RaspAP is pretty streamlined as it is. A docker container might be overkill for how many systemd services are involved. It may turn into a docker-compose deployment, behind more networking complexity.
I think the investigation approach also solves @danielwilson654 's problem. We just want to run Docker and RaspAP on the same Pi.
18 remaining items
1ubuntuuser commentedon May 9, 2021
@noxPHX thanks I've had a look. I'll get testing. Does client mode work with your setup?
luandro commentedon Nov 1, 2021
@jrcichra I see u were trying to get RaspAP to work with Balena. Have you managed to get it deployed?
I started a discussion around this at the Balena forum. But still have no idea how to move forward.
billz commentedon Nov 1, 2021
@luandro we'd love to see RaspAP deployed with Balena.
frankly @jrcichra is the real docker expert here. I'm available to help push things forward
jrcichra commentedon Nov 2, 2021
Hi, I have a spare Pi I can qualify with the Balena docker image. I have more container/Linux know-how since last year so I should be able to assist more. Things like adblock and VPN should work if we set
--network=host. Interacting with hardware will be done with the--privilegedflag. Essentially we'll be using the docker container to isolate all the config files and processes, but with none of the networking abstractions.We'll want to make sure nothing on the host system will clash with what's being described in the RaspAP container. Disabling daemons like
wpa-supplicantoutside the container might be necessary. It might take some work to get it feature-compatible...and it might take more than just adocker runfor the end-user.luandro commentedon Nov 2, 2021
This is the Balena docker-compose I'm trying:
jrcichra commentedon Nov 2, 2021
Ok. I think I'm where you're at. The guide at https://github.com/RaspAP/raspap-docker still works where the webgui comes up. But starting the hotspot in the container fails:
...but that's a separate problem we can get to once we're on Balena.
I remember now that the
jrcichra/raspapdis based on some random outdated systemd container. A potential first step is getting systemd running in Balena. The downside of systemd in a container is...when you're building the container, systemd is not running. So the install script needs to dosystemctl enable <service>and notsystemctl enable --now <service>. That's why in the existing container, I have the user do the install script by hand.So step 1 seems to be Balena systemd to support
hostapd,dnsmasq,dhcpcd,lighttpd, etc easily. https://github.com/alehaa/docker-debian-systemd might be a good reference we can slide Balena under.jrcichra commentedon Nov 2, 2021
I was able to get systemd at least running in the container with this
Dockerfileslimmed down from the work https://github.com/alehaa/docker-debian-systemd did:Next I'll see if I can install the script with the container running.
jrcichra commentedon Nov 2, 2021
I'm where I was at before. Using Belena as a base is much nicer, especially with
install_packages. I'm getting this output forhostapdwhen enabling the hotspot:It looks like we can't interact with the wlan0 kernel driver:
...even though we should be able to interact with the host kernel (in theory).
I got here by doing:
Then the webgui should appear on port 80 and if you do
...while trying to turn on Hotspotting you should be in the same boat with the wlan0 failure.
jrcichra commentedon Nov 2, 2021
Ok, by dealing with
rfkilland disablingsystemd-resolved+wpa_supplicantwhere I could, I was able to start uphostapdanddnsmasqin the container. I can see the wifi SSID and the password works. Where I'm stuck now is withdnsmasq-dhcp. I can't get an IP address from the AP. I'm getting this error, but the config (I believe) is set up properly to serve dhcp:luandro commentedon Nov 2, 2021
@jrcichra Not sure it helps, but this is how I usually setup dnsmasq/dhcp:
jrcichra commentedon Nov 2, 2021
@luandro yeah, I'd think that would work but for some reason it doesn't:
We're very close though!!!
NL-TCH commentedon May 9, 2024
@billz @jrcichra
this one can be closed right?
as https://github.com/RaspAP/raspap-docker is stable (https://docs.raspap.com/docker/)
billz commentedon May 10, 2024
@NL-TCH it sure can, thanks