I am new to Docker, but I have experience of using VM and hypervisor. Referring to Docker introduction and this image, Docker containers are isolated but share the same host OS.
If we deploy only 1 Docker container (e.g. LAMP app) in a host OS, can the Docker container uses the full CPU power and memory of the host OS?
Is there any performance difference between a LAMP app running in a Docker container and a LAMP app running in the host OS directly?
tl;dr: There is a difference but generally so small that it's not worth worrying about.
For the most part, containers can use the full CPU and RAM of the host system. There is a little bit of CPU overhead to actually run a container but it's small enough that it's generally considered to be zero. RAM usage is in the same boat. The docker server does require a certain amount of CPU and RAM. Both are pretty small when compared to running the app in a VM.