Accessing NAS from a VM or Apps

For the most part, the support doc linked below only talks about assigning a VM to a VLAN. Where can I find documentation on how to assign an App to a VLAN?

It looks like the ability to assign an App to a VLAN is functionality being added to 25.04. In the meantime, it is possible to use custom docker compose ymls to assign an “App” to a VLAN. Do I have that right?

That link talks about using a bridge. It does not mention VLAN a single time.

But to answer your question, yes, you can use a custom docker-compose yaml to assign an app to a VLAN. I’m using the dockage app to manage my docker-compose. I have no special configuration for dockage itself, but here’s a compose file from one of my apps (ESPHome) running inside dockage.

version: "3.8"
networks:
  vlan88:
    driver: macvlan
    driver_opts:
      parent: br0.88
    ipam:
      config:
        - subnet: 192.168.88.0/24
          gateway: 192.168.88.1
services:
  esphome:
    container_name: esphome
    image: ghcr.io/esphome/esphome
    volumes:
      - /mnt/ssd/apps/esphome/config:/config
      - /etc/localtime:/etc/localtime:ro
    networks:
      vlan88:
        ipv4_address: 192.168.88.6
    restart: unless-stopped

Did you create the VLAN and bridge to the physical interface prior to running the compose? I’m also wondering if I can create the network using the Docker CLI, then reference the network and assign a static IP for all of the containers I want to assign to that VLAN.

Thank you

I only created the bridge interface on TrueNAS.

I was able to create a network using the docker CLI when I was on electric eel and it did survive the upgrade to fangtooth, but I’m not sure if that will always be the case.