1 Integrations docker macvlans
bakito edited this page 2026-02-27 00:03:03 +01:00

Running in Docker on MacVLANs

WHen origin and sync containers are both running in the same hardware, and origin is also running in a macvlan. The replica runs in different hardware (also OMV and in a macvlan) There is a routing issue between the sync tool and the macvlan.

The Linux kernel's macvlan isolation security policy explicitly forbids a Docker host (and its bridge-networked containers) from communicating with its own macvlan child interfaces to prevent network loops and hardware confusion. Docker Macvlan Networking Documentation

The URL needs to point to the container name and not the IP address - ie url: http://adguardhome

# Compose yaml
services:
  adguard-home:
    container_name: adguardhome
    image: adguard/adguardhome
    restart: unless-stopped
    networks:
      macvlan:
        ipv4_address: <macvlan_ip_address>
      sync-internal:
    ports:
      - 53:53/tcp
      - 53:53/udp
      - 80:80/tcp
      - 443:443/tcp
      - 443:443/udp
      - 3000:3000/tcp
      - 853:853/udp
      - 853:853/tcp
      - 784:784/udp
      - 8853:8853/udp
      - 5443:5443/tcp
      - 5443:5443/udp
    volumes:
      - <volume by UUID>/appdata/adguardhome/workdir:/opt/adguardhome/work
      - <volume by UUID>/appdata/adguardhome/confdir:/opt/adguardhome/conf
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 30s # Gives AGH 30s to boot before it starts failing the check

  adguardhome-sync:
    image: ghcr.io/bakito/adguardhome-sync:latest
    container_name: adguardhome-sync
    depends_on:
      adguard-home:
        condition: service_healthy
    restart: unless-stopped
    environment:
      - PUID=1000
      - PGID=100
      - TZ=America/New_York
      - CONFIG_FILE=/config/adguardhome-sync.yaml
    volumes:
      - <volume by UUID>/appdata/adguardhome-sync/config:/config
    ports:
      - 8088:8080 # Remap port if necessary
    networks:
      - sync-internal

networks:
  macvlan:
    driver: macvlan
    driver_opts:
      parent: <eth0> # Replace with interface name 
    ipam:
      config:
        - subnet: <macvlan subnet>/24   # Correct mask for your LAN
          gateway: <router ip>    # Your router IP
  sync-internal:
    driver: bridge