I have a container A running a VPN client, then I traffic other containers' (B and C) traffic via container A.
Is there a way to create a container D, which internally is running something like HostAP or RaspAP for the creation a wifi network in e.g. interface
wlan0, and then all the traffic is routed via container A?
I found some docker images in docker hub with the above clients for my architechture, and while the few descriptions they have seem to have similar purpose to what I am trying to achieve, none of the worked properly.
If previous option is not possible, how could this be achieved by directly changing the files in the host OS (Raspbian)? The host is connected via
eth0 to the router.
First I tried to run the containers directly from the interface
eth0 and then tried to attach it to container A. None of them worked.
Docker compose for hostap:
sudo docker run --restart unless-stopped -dit --name hostap \
-e INTERFACE=docker0 \
-e CHANNEL=6 \
-e SSID=runssid \
-e AP_ADDR=192.168.254.1 \
-e SUBNET=192.168.254.0 \
-e WPA_PASSPHRASE=passw0rd \
-e OUTGOINGS=eth0 \
-e HW_MODE=g \
--net host --privileged sdelrio/rpi-hostap:latest
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested
Then it crashes the entire raspberry docker installation (no access to any other container). I have to kill the container and eliminate to re-gain access.
** Docker compose using raspap:**
sudo docker run --name raspap -it -d --privileged --network=host -v /sys/fs/cgroup:/sys/fs/cgroup:ro --cap-add SYS_ADMIN jrcichra/raspap-docker
This one stops the container after its creation.
systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
Detected virtualization docker.
Detected architecture arm.
Welcome to Debian GNU/Linux 10 (buster)!
Set hostname to <Server-Pi>.
Failed to create /init.scope control group: Read-only file system
Failed to allocate manager object: Read-only file system
[!!!!!!] Failed to allocate manager object.
- Docker running on Raspbian in a Raspberry Pi 4
Docker images checked:
Thanks in advance.