What is the best method for managing networks with TorizonOS and Docker containers?

@jeremias.tx

That thread you referenced is one of the ones I had read through while trying to tackle this issue myself and I actually did have the bind-mount you mentioned in my docker compose already, guess I just didn’t copy down far enough.

I still am struggling to access NMCLI through the container. With docker-compose as shown below I am getting NetworkManager not running errors. If I manually start NetworkManager using the NetworkManager cmd I get NMCLI. I cannot seem to get NetworkManager to start by default.

build:
      context: .
      dockerfile: Dockerfile.debug
    image: ${LOCAL_REGISTRY}:5002/remotemonitor-debug:${TAG}
    network_mode: "host"
    ports:
      - 6502:6502
      - 6512:6512
      - 5000:5000
      - 502:502
    environment:
      - APP_ROOT=/home/torizon/app
    cap_add:
      - NET_ADMIN
    volumes:
       - appdata:${APP_ROOT}/src/data
       - /etc/NetworkManager:/etc/NetworkManager
       - /var/run/dbus:/var/run/dbus
root@verdin-am62-15207040:/# nmcli
Error: NetworkManager is not running.
root@verdin-am62-15207040:/# NetworkManager
root@verdin-am62-15207040:/# nmcli -t
ethernet0: connected to network0
        "ethernet0"
        ethernet (am65-cpsw-nuss), 00:14:2D:E8:0A:80, hw, mtu 1500
        ip4 default
        inet4 10.10.10.69/24
        route4 default via 10.10.10.2 metric 100
        route4 10.10.10.0/24 metric 100
        route4 default via 10.10.10.2 metric 100
        inet6 fe80::ea53:2ce0:3ba4:1a1d/64
        route6 fe80::/64 metric 1024

As I mentioned in my initial post, I have tried getting NetworkManager to start by default through my entrypoint.sh, but I am not having any luck with that. What am I missing here that is preventing my Docker container from seeing NetworkManager running on start?

I am able to get NetworkManager running by using this CMD at the end of the Dockerfile, however the Torizon IDE is no longer able to connect to the board for debugging without the sshd command and it appears as those my Python script is not launching with the new CMD line shown.

# CMD [ "/usr/sbin/sshd", "-D" ]
CMD ["/usr/sbin/NetworkManager", "--no-daemon"]