Top-level volume with absolute path

What’s apparently missing (I got an error) is the type attribute:

services:
  foo:
    volumes:
      - bar:/dir_container

volumes:
  bar:
    driver: local
    driver_opts:
      device: /dir_host
      o: bind
      type: local

With this set, it works flawlessly.