version: '2'
services:
  libvirt:
    build: ../docker/libvirt/
    pid: host
    privileged: true
    # ports:
    #   - "16509:16509"
    # network_mode: host
    restart: always
    environment:
      - LIBVIRT_CLEANUP=""
    volumes:
      - /lib/modules:/lib/modules:ro
      - /run:/run
      - /dev:/dev
      - /var/lib/virtlet:/var/lib/virtlet
      - /sys/fs/cgroup:/sys/fs/cgroup
      - ./libvirt.conf:/etc/libvirt/libvirtd.conf
      - ./qemu.conf:/etc/libvirt/qemu.conf
      - libvirtd:/var/lib/libvirt
      - libvirt_qemu:/etc/libvirt/qemu
  virtlet:
    build: ../..
    # network_mode: host
    restart: always
    volumes:
      - virtlet_data:/var/data/virtlet
      - /var/lib/virtlet:/var/lib/virtlet
      - /lib/modules:/lib/modules:ro
      - /boot:/boot:ro
      - /run:/run
    depends_on:
      - libvirt
    links:
      - "libvirt:libvirt"
volumes:
  libvirtd: {}
  libvirt_qemu: {}
  virtlet_data: {}

version: '2'
services:
  libvirt:
    build: ../docker/libvirt/
    pid: host
    privileged: true
    # ports:
    #   - "16509:16509"
    # network_mode: host
    restart: always
    environment:
      - LIBVIRT_CLEANUP
    volumes:
      - /lib/modules:/lib/modules:ro
      - /run:/run
      - /dev:/dev
      - /var/lib/virtlet:/var/lib/virtlet
      - /sys/fs/cgroup:/sys/fs/cgroup
      - ./libvirt.conf:/etc/libvirt/libvirtd.conf
      - ./qemu.conf:/etc/libvirt/qemu.conf
      - libvirtd:/var/lib/libvirt
      - libvirt_qemu:/etc/libvirt/qemu
  virtlet:
    build: ../..
    # network_mode: host
    restart: always
    volumes:
      - virtlet_data:/var/data/virtlet
      - /var/lib/virtlet:/var/lib/virtlet
      - /lib/modules:/lib/modules:ro
      - /boot:/boot:ro
      - /run:/run
    depends_on:
      - libvirt
    links:
      - "libvirt:libvirt"
volumes:
  libvirtd: {}
  libvirt_qemu: {}
  virtlet_data: {}

Fix cleanup of libvirt data
contrib: Fix cleanup of libvirt data

Following instructions from:
https://docs.docker.com/compose/environment-variables/#/passing-environment-variables-through-to-containers
