Docker containers have much more potential as compared to virtual machines (VMs) since Docker containers can be used to share a kernel as well as application libraries, unlike VMs. The applications inside a container are usually better than ones within VMs since it presents a lower system overhead. Containers virtualize only OS resources; whereas, VMs virtualize hardware resources. There are many such differences between Docker and virtual machines and you can learn about them in this Docker Tutorial for Beginners.
You should also, watch Intellipaat’s ‘What is Docker?’ video to see how exactly a Docker container is different from a virtual machine: