A container is an isolated environment for running an application.
A virtual machine is an abstraction of a physical machine. It is a complete environment that includes the operating system, applications, and libraries.
NB: Containers only include the application and its dependencies.