Skip to content

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

Description

@ptimlick

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions