# Docker vs. Virtual Machine

1. Layer – Kernel communicates with hardware (CPU, Hard drive, RAM etc.)
2. Layer – Application run on kernel layer.

![](https://2601183865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8QpIzz6VwCOTMwaqKYa3%2Fuploads%2FYVfXSacz3rwjQEmvZqEL%2Fimage.png?alt=media\&token=76e1eb69-8273-42f9-9ad9-ebe5220ba1ea)

![](https://2601183865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8QpIzz6VwCOTMwaqKYa3%2Fuploads%2F6fQqOESHDdFYXwojaFZQ%2Fimage.png?alt=media\&token=930db228-e1de-44f2-a4f7-53cef3041e27)

![](https://2601183865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8QpIzz6VwCOTMwaqKYa3%2Fuploads%2FrJOaspjKH3TOYnK96Yl7%2Fimage.png?alt=media\&token=a40d4eae-84fc-456a-b027-476ce3714d72)

### Container architecture&#x20;

A container is an isolated, lightweight silo for running an application on the host operating system. Containers build on top of the host operating system's kernel (which can be thought of as the buried plumbing of the operating system), and contain only apps and some lightweight operating system APIs and services that run in user mode, as shown in this diagram.

<figure><img src="https://2601183865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8QpIzz6VwCOTMwaqKYa3%2Fuploads%2FOwSrGt87LihJ9Qix059E%2Fimage.png?alt=media&#x26;token=08847996-b3bb-48f2-b709-7c4c2a44b0d4" alt=""><figcaption></figcaption></figure>

### Virtual machine architecture&#x20;

In contrast to containers, VMs run a complete operating system–including its own kernel–as shown in this diagram.

<figure><img src="https://2601183865-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8QpIzz6VwCOTMwaqKYa3%2Fuploads%2FMoQgJh4Op6Upck0lVdR2%2Fimage.png?alt=media&#x26;token=db9fa6bc-101b-481e-b2bd-686840864f8b" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://asafahmadov.gitbook.io/cloud-and-devops/devops-bootcamp/containers-with-docker/docker-vs.-virtual-machine.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
