Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--net option to override docker --net=bridge on docker-ap start command #12

Open
ptimlick opened this issue Jun 15, 2021 · 0 comments
Open

Comments

@ptimlick
Copy link

I have used this fine container for connectivity from wifi clients to a local multiple docker-compose application https://github.com/getodk/central. I did this by modifying docker_ap thus:

diff --git a/docker_ap b/docker_ap
index ab33c97..b6de9c9 100755
--- a/docker_ap
+++ b/docker_ap
@@ -214,7 +214,7 @@ init () {
 service_start () { 
     IFACE="$1"
     echo -e "[+] Starting the docker container with name ${GREEN}$DOCKER_NAME${NC}"
-    docker run -dt --name $DOCKER_NAME --net=bridge --cap-add=NET_ADMIN --cap-add=NET_RAW -v "$PATHSCRIPT"/hostapd.conf:/etc/hostapd/hostapd.conf -v "$PATHSCRIPT"/dnsmasq.conf:/etc/dnsmasq.conf $DOCKER_IMAGE > /dev/null 2>&1
+    docker run -dt --name $DOCKER_NAME --net=central_default --cap-add=NET_ADMIN --cap-add=NET_RAW -v "$PATHSCRIPT"/hostapd.conf:/etc/hostapd/hostapd.conf -v "$PATHSCRIPT"/dnsmasq.conf:/etc/dnsmasq.conf $DOCKER_IMAGE > /dev/null 2>&1
     pid=$(docker inspect -f '{{.State.Pid}}' $DOCKER_NAME)     

   # Assign phy wireless interface to the container 

I propose that the docker_ap command get a new option -n or --net= , In my case I would execute docker_ap --net=central_default ... . I also propose that the script check that the value of the -n or --net option is a valid docker network name, and "error out" if it is not. This proposal is backwards compatible; it would not break existing users. This enhancement will be for a system to be used by the Red Cross, where I am a volunteer.

@ptimlick ptimlick changed the title --net option to overried docker --net=bridge on docker-ap start command --net option to override docker --net=bridge on docker-ap start command Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant