How is a Docker container different from a hypervisor?

In a Hypervisor environment, we first create a Virtual Machine and then install an operating System on it. After that, we deploy the application. The virtual machine may also be installed on different hardware configurations. In a Docker environment, we just deploy the application in Docker. There is no OS layer in this environment. We specify libraries and the rest of the kernel is provided by the Docker engine. In a way, the Docker container and hypervisor are complementary to each other.