VM advantage over docker is that VM actually emulate hardware. You will have much finer control over the CPU, network and about everything where on Docker, you will be limited by host's hardware.
Moreover, with VM, you can run non-linux host like Windows, BSD or Solaris. Docker is limited by its linux kernel dependency.